summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-common.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-09-18 08:22:32 +0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 22:01:29 +0100
commit393bf5573269979aa3fb55d1bdd0db4fcb288f99 (patch)
treec514bb358342276c57adaa9586e51738630a8df4 /drivers/media/video/v4l2-common.c
parentV4L/DVB (6466): v4l2-i2c-drv: first call remove, then detach client (diff)
downloadlinux-393bf5573269979aa3fb55d1bdd0db4fcb288f99.tar.xz
linux-393bf5573269979aa3fb55d1bdd0db4fcb288f99.zip
V4L/DVB (6467): v4l2-common: minor cleanups
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/v4l2-common.c')
-rw-r--r--drivers/media/video/v4l2-common.c5
1 files changed, 2 insertions, 3 deletions
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;