diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-10 16:20:42 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-11 13:32:17 -0400 |
commit | cc1e6315e83db0e517dd9279050b88adc83a7eba (patch) | |
tree | 2fab5c7b2a4f3f50a045357a41c419fccc975de2 /drivers/media/usb/pwc | |
parent | c0decac19da3906d9b66291e57b7759489e1170f (diff) |
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/pwc')
-rw-r--r-- | drivers/media/usb/pwc/pwc-if.c | 2 | ||||
-rw-r--r-- | drivers/media/usb/pwc/pwc-v4l.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/usb/pwc/pwc-if.c b/drivers/media/usb/pwc/pwc-if.c index 54b036d39c5b..72704f4d5330 100644 --- a/drivers/media/usb/pwc/pwc-if.c +++ b/drivers/media/usb/pwc/pwc-if.c | |||
@@ -1027,7 +1027,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id | |||
1027 | 1027 | ||
1028 | /* Init video_device structure */ | 1028 | /* Init video_device structure */ |
1029 | pdev->vdev = pwc_template; | 1029 | pdev->vdev = pwc_template; |
1030 | strcpy(pdev->vdev.name, name); | 1030 | strscpy(pdev->vdev.name, name, sizeof(pdev->vdev.name)); |
1031 | pdev->vdev.queue = &pdev->vb_queue; | 1031 | pdev->vdev.queue = &pdev->vb_queue; |
1032 | pdev->vdev.queue->lock = &pdev->vb_queue_lock; | 1032 | pdev->vdev.queue->lock = &pdev->vb_queue_lock; |
1033 | video_set_drvdata(&pdev->vdev, pdev); | 1033 | video_set_drvdata(&pdev->vdev, pdev); |
diff --git a/drivers/media/usb/pwc/pwc-v4l.c b/drivers/media/usb/pwc/pwc-v4l.c index 0673238c2c63..bef6e4ef8a7e 100644 --- a/drivers/media/usb/pwc/pwc-v4l.c +++ b/drivers/media/usb/pwc/pwc-v4l.c | |||
@@ -492,7 +492,7 @@ static int pwc_querycap(struct file *file, void *fh, struct v4l2_capability *cap | |||
492 | { | 492 | { |
493 | struct pwc_device *pdev = video_drvdata(file); | 493 | struct pwc_device *pdev = video_drvdata(file); |
494 | 494 | ||
495 | strcpy(cap->driver, PWC_NAME); | 495 | strscpy(cap->driver, PWC_NAME, sizeof(cap->driver)); |
496 | strscpy(cap->card, pdev->vdev.name, sizeof(cap->card)); | 496 | strscpy(cap->card, pdev->vdev.name, sizeof(cap->card)); |
497 | usb_make_path(pdev->udev, cap->bus_info, sizeof(cap->bus_info)); | 497 | usb_make_path(pdev->udev, cap->bus_info, sizeof(cap->bus_info)); |
498 | cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING | | 498 | cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING | |