From: Hans Verkuil Date: Tue, 18 Sep 2007 06:22:32 +0000 (-0300) Subject: V4L/DVB (6467): v4l2-common: minor cleanups X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=393bf5573269979aa3fb55d1bdd0db4fcb288f99;p=openwrt%2Fstaging%2Fblogic.git V4L/DVB (6467): v4l2-common: minor cleanups Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c index 61ebdb0afa12..c056ff6d810c 100644 --- a/drivers/media/video/v4l2-common.c +++ b/drivers/media/video/v4l2-common.c @@ -1028,13 +1028,12 @@ int v4l2_i2c_attach(struct i2c_adapter *adapter, int address, struct i2c_driver client->addr = address; client->adapter = adapter; client->driver = driver; - snprintf(client->name, sizeof(client->name) - 1, name); + strlcpy(client->name, name, sizeof(client->name)); err = probe(client); if (err == 0) { i2c_attach_client(client); - } - else { + } else { kfree(client); } return err != -ENOMEM ? 0 : err;