From: Hans Verkuil Date: Tue, 18 Sep 2007 06:22:32 +0000 (-0300) Subject: V4L/DVB (6467): v4l2-common: minor cleanups X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=393bf5573269979aa3fb55d1bdd0db4fcb288f99;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.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;