diff options
Diffstat (limited to 'drivers/media/video/tegra/ov9772.c')
-rw-r--r-- | drivers/media/video/tegra/ov9772.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/media/video/tegra/ov9772.c b/drivers/media/video/tegra/ov9772.c index 9a312b8c489b..f8797c521316 100644 --- a/drivers/media/video/tegra/ov9772.c +++ b/drivers/media/video/tegra/ov9772.c @@ -201,6 +201,7 @@ struct ov9772_info { u8 i2c_buf[OV9772_SIZEOF_I2C_BUF]; u8 bin_en; struct nvc_fuseid fuse_id; + char devname[16]; }; struct ov9772_reg { @@ -2198,7 +2199,6 @@ static int ov9772_probe( const struct i2c_device_id *id) { struct ov9772_info *info; - char dname[16]; unsigned long clock_probe_rate; int err; @@ -2261,18 +2261,19 @@ static int ov9772_probe( info->pdata->probe_clock(0); } if (info->pdata->dev_name != 0) - strcpy(dname, info->pdata->dev_name); + strncpy(info->devname, info->pdata->dev_name, + sizeof(info->devname) - 1); else - strcpy(dname, "ov9772"); + strncpy(info->devname, "ov9772", sizeof(info->devname) - 1); if (info->pdata->num) - snprintf(dname, sizeof(dname), "%s.%u", - dname, info->pdata->num); - info->miscdev.name = dname; + snprintf(info->devname, sizeof(info->devname), "%s.%u", + info->devname, info->pdata->num); + info->miscdev.name = info->devname; info->miscdev.fops = &ov9772_fileops; info->miscdev.minor = MISC_DYNAMIC_MINOR; if (misc_register(&info->miscdev)) { dev_err(&client->dev, "%s unable to register misc device %s\n", - __func__, dname); + __func__, info->devname); ov9772_del(info); return -ENODEV; } |