diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-10 23:20:42 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-11 20:32:17 +0300 |
commit | cc1e6315e83db0e517dd9279050b88adc83a7eba (patch) | |
tree | 2fab5c7b2a4f3f50a045357a41c419fccc975de2 /drivers/media/usb/cx231xx | |
parent | c0decac19da3906d9b66291e57b7759489e1170f (diff) | |
download | linux-cc1e6315e83db0e517dd9279050b88adc83a7eba.tar.xz |
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/cx231xx')
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-audio.c | 8 | ||||
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-video.c | 9 |
2 files changed, 9 insertions, 8 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-audio.c b/drivers/media/usb/cx231xx/cx231xx-audio.c index 32ee7b3f21c9..77f2c65eb79a 100644 --- a/drivers/media/usb/cx231xx/cx231xx-audio.c +++ b/drivers/media/usb/cx231xx/cx231xx-audio.c @@ -679,10 +679,10 @@ static int cx231xx_audio_init(struct cx231xx *dev) &snd_cx231xx_pcm_capture); pcm->info_flags = 0; pcm->private_data = dev; - strcpy(pcm->name, "Conexant cx231xx Capture"); - strcpy(card->driver, "Cx231xx-Audio"); - strcpy(card->shortname, "Cx231xx Audio"); - strcpy(card->longname, "Conexant cx231xx Audio"); + strscpy(pcm->name, "Conexant cx231xx Capture", sizeof(pcm->name)); + strscpy(card->driver, "Cx231xx-Audio", sizeof(card->driver)); + strscpy(card->shortname, "Cx231xx Audio", sizeof(card->shortname)); + strscpy(card->longname, "Conexant cx231xx Audio", sizeof(card->longname)); INIT_WORK(&dev->wq_trigger, audio_trigger); diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c index 7759bc66f18c..29160df76cf7 100644 --- a/drivers/media/usb/cx231xx/cx231xx-video.c +++ b/drivers/media/usb/cx231xx/cx231xx-video.c @@ -1169,7 +1169,7 @@ int cx231xx_enum_input(struct file *file, void *priv, i->index = n; i->type = V4L2_INPUT_TYPE_CAMERA; - strcpy(i->name, iname[INPUT(n)->type]); + strscpy(i->name, iname[INPUT(n)->type], sizeof(i->name)); if ((CX231XX_VMUX_TELEVISION == INPUT(n)->type) || (CX231XX_VMUX_CABLE == INPUT(n)->type)) @@ -1244,7 +1244,7 @@ int cx231xx_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t) if (0 != t->index) return -EINVAL; - strcpy(t->name, "Tuner"); + strscpy(t->name, "Tuner", sizeof(t->name)); t->type = V4L2_TUNER_ANALOG_TV; t->capability = V4L2_TUNER_CAP_NORM; @@ -1716,7 +1716,7 @@ static int radio_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t) if (t->index) return -EINVAL; - strcpy(t->name, "Radio"); + strscpy(t->name, "Radio", sizeof(t->name)); call_all(dev, tuner, g_tuner, t); @@ -2242,7 +2242,8 @@ int cx231xx_register_analog_devices(struct cx231xx *dev) /* Initialize VBI template */ cx231xx_vbi_template = cx231xx_video_template; - strcpy(cx231xx_vbi_template.name, "cx231xx-vbi"); + strscpy(cx231xx_vbi_template.name, "cx231xx-vbi", + sizeof(cx231xx_vbi_template.name)); /* Allocate and fill vbi video_device struct */ cx231xx_vdev_init(dev, &dev->vbi_dev, &cx231xx_vbi_template, "vbi"); |