diff options
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/v4l2-common.c | 5 |
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; |