summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/usbvision
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-10 22:20:42 +0200
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-11 19:32:17 +0200
commitcc1e6315e83db0e517dd9279050b88adc83a7eba (patch)
tree2fab5c7b2a4f3f50a045357a41c419fccc975de2 /drivers/media/usb/usbvision
parentmedia: use strscpy() instead of strlcpy() (diff)
downloadlinux-cc1e6315e83db0e517dd9279050b88adc83a7eba.tar.xz
linux-cc1e6315e83db0e517dd9279050b88adc83a7eba.zip
media: replace strcpy() by strscpy()
The strcpy() function is being deprecated upstream. Replace it by the safer strscpy(). Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/usb/usbvision')
-rw-r--r--drivers/media/usb/usbvision/usbvision-video.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c
index f4e758e5f3ec..dd2ff8ed6c6a 100644
--- a/drivers/media/usb/usbvision/usbvision-video.c
+++ b/drivers/media/usb/usbvision/usbvision-video.c
@@ -504,9 +504,9 @@ static int vidioc_enum_input(struct file *file, void *priv,
switch (chan) {
case 0:
if (usbvision_device_data[usbvision->dev_model].video_channels == 4) {
- strcpy(vi->name, "White Video Input");
+ strscpy(vi->name, "White Video Input", sizeof(vi->name));
} else {
- strcpy(vi->name, "Television");
+ strscpy(vi->name, "Television", sizeof(vi->name));
vi->type = V4L2_INPUT_TYPE_TUNER;
vi->tuner = chan;
vi->std = USBVISION_NORMS;
@@ -515,22 +515,23 @@ static int vidioc_enum_input(struct file *file, void *priv,
case 1:
vi->type = V4L2_INPUT_TYPE_CAMERA;
if (usbvision_device_data[usbvision->dev_model].video_channels == 4)
- strcpy(vi->name, "Green Video Input");
+ strscpy(vi->name, "Green Video Input", sizeof(vi->name));
else
- strcpy(vi->name, "Composite Video Input");
+ strscpy(vi->name, "Composite Video Input",
+ sizeof(vi->name));
vi->std = USBVISION_NORMS;
break;
case 2:
vi->type = V4L2_INPUT_TYPE_CAMERA;
if (usbvision_device_data[usbvision->dev_model].video_channels == 4)
- strcpy(vi->name, "Yellow Video Input");
+ strscpy(vi->name, "Yellow Video Input", sizeof(vi->name));
else
- strcpy(vi->name, "S-Video Input");
+ strscpy(vi->name, "S-Video Input", sizeof(vi->name));
vi->std = USBVISION_NORMS;
break;
case 3:
vi->type = V4L2_INPUT_TYPE_CAMERA;
- strcpy(vi->name, "Red Video Input");
+ strscpy(vi->name, "Red Video Input", sizeof(vi->name));
vi->std = USBVISION_NORMS;
break;
}
@@ -589,9 +590,9 @@ static int vidioc_g_tuner(struct file *file, void *priv,
if (vt->index) /* Only tuner 0 */
return -EINVAL;
if (vt->type == V4L2_TUNER_RADIO)
- strcpy(vt->name, "Radio");
+ strscpy(vt->name, "Radio", sizeof(vt->name));
else
- strcpy(vt->name, "Television");
+ strscpy(vt->name, "Television", sizeof(vt->name));
/* Let clients fill in the remainder of this struct */
call_all(usbvision, tuner, g_tuner, vt);
@@ -814,7 +815,8 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
{
if (vfd->index >= USBVISION_SUPPORTED_PALETTES - 1)
return -EINVAL;
- strcpy(vfd->description, usbvision_v4l2_format[vfd->index].desc);
+ strscpy(vfd->description, usbvision_v4l2_format[vfd->index].desc,
+ sizeof(vfd->description));
vfd->pixelformat = usbvision_v4l2_format[vfd->index].format;
return 0;
}