From 393bf5573269979aa3fb55d1bdd0db4fcb288f99 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Tue, 18 Sep 2007 03:22:32 -0300 Subject: V4L/DVB (6467): v4l2-common: minor cleanups Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/v4l2-common.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/media/video/v4l2-common.c') 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; -- cgit v1.2.3