aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
1028 client->addr = address; 1028 client->addr = address;
1029 client->adapter = adapter; 1029 client->adapter = adapter;
1030 client->driver = driver; 1030 client->driver = driver;
1031 snprintf(client->name, sizeof(client->name) - 1, name); 1031 strlcpy(client->name, name, sizeof(client->name));
1032 1032
1033 err = probe(client); 1033 err = probe(client);
1034 if (err == 0) { 1034 if (err == 0) {
1035 i2c_attach_client(client); 1035 i2c_attach_client(client);
1036 } 1036 } else {
1037 else {
1038 kfree(client); 1037 kfree(client);
1039 } 1038 }
1040 return err != -ENOMEM ? 0 : err; 1039 return err != -ENOMEM ? 0 : err;