From 67da967ca82fae5cdaba3d5b646bc505ba423813 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Tue, 18 Sep 2007 08:22:32 +0200 Subject: v4l2-common: minor cleanups. From: Hans Verkuil Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/v4l2-common.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- linux/drivers/media/video/v4l2-common.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/linux/drivers/media/video/v4l2-common.c b/linux/drivers/media/video/v4l2-common.c index f97d14486..a1d751c8a 100644 --- a/linux/drivers/media/video/v4l2-common.c +++ b/linux/drivers/media/video/v4l2-common.c @@ -1640,10 +1640,10 @@ int v4l2_i2c_attach(struct i2c_adapter *adapter, int address, struct i2c_driver client->addr = address; client->adapter = adapter; client->driver = driver; -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15) +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15) client->flags = I2C_CLIENT_ALLOW_USE; #endif - snprintf(client->name, sizeof(client->name) - 1, name); + strlcpy(client->name, name, sizeof(client->name)); err = probe(client); if (err == 0) { @@ -1651,8 +1651,7 @@ int v4l2_i2c_attach(struct i2c_adapter *adapter, int address, struct i2c_driver #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) MOD_INC_USE_COUNT; #endif - } - else { + } else { kfree(client); } return err != -ENOMEM ? 0 : err; -- cgit v1.2.3