V4L/DVB (6467): v4l2-common: minor cleanups
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
index 61ebdb0..c056ff6 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -1028,13 +1028,12 @@
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;