V4L/DVB (6467): v4l2-common: minor cleanups
authorHans Verkuil <hverkuil@xs4all.nl>
Tue, 18 Sep 2007 06:22:32 +0000 (03:22 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 25 Jan 2008 21:01:29 +0000 (19:01 -0200)
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/v4l2-common.c

index 61ebdb0afa12f54373c5b254e0b21696841b46e8..c056ff6d810c8e4d18026529d4aa96caad8ba5fa 100644 (file)
@@ -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;