diff options
Diffstat (limited to 'drivers/media/usb')
21 files changed, 84 insertions, 77 deletions
diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c index aa25c19437ad..efbf210147c7 100644 --- a/drivers/media/usb/au0828/au0828-video.c +++ b/drivers/media/usb/au0828/au0828-video.c @@ -1218,7 +1218,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, dprintk(1, "%s called\n", __func__); f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - strcpy(f->description, "Packed YUV2"); + strscpy(f->description, "Packed YUV2", sizeof(f->description)); f->flags = 0; f->pixelformat = V4L2_PIX_FMT_UYVY; @@ -1349,7 +1349,7 @@ static int vidioc_enum_input(struct file *file, void *priv, return -EINVAL; input->index = tmp; - strcpy(input->name, inames[AUVI_INPUT(tmp).type]); + strscpy(input->name, inames[AUVI_INPUT(tmp).type], sizeof(input->name)); if ((AUVI_INPUT(tmp).type == AU0828_VMUX_TELEVISION) || (AUVI_INPUT(tmp).type == AU0828_VMUX_CABLE)) { input->type |= V4L2_INPUT_TYPE_TUNER; @@ -1465,9 +1465,9 @@ static int vidioc_enumaudio(struct file *file, void *priv, struct v4l2_audio *a) dprintk(1, "%s called\n", __func__); if (a->index == 0) - strcpy(a->name, "Television"); + strscpy(a->name, "Television", sizeof(a->name)); else - strcpy(a->name, "Line in"); + strscpy(a->name, "Line in", sizeof(a->name)); a->capability = V4L2_AUDCAP_STEREO; return 0; @@ -1482,9 +1482,9 @@ static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a) a->index = dev->ctrl_ainput; if (a->index == 0) - strcpy(a->name, "Television"); + strscpy(a->name, "Television", sizeof(a->name)); else - strcpy(a->name, "Line in"); + strscpy(a->name, "Line in", sizeof(a->name)); a->capability = V4L2_AUDCAP_STEREO; return 0; @@ -1518,7 +1518,7 @@ static int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t) dprintk(1, "%s called std_set %d dev_state %ld\n", __func__, dev->std_set_in_tuner_core, dev->dev_state); - strcpy(t->name, "Auvitek tuner"); + strscpy(t->name, "Auvitek tuner", sizeof(t->name)); au0828_init_tuner(dev); i2c_gate_ctrl(dev, 1); @@ -1978,7 +1978,7 @@ int au0828_analog_register(struct au0828_dev *dev, dev->vdev.lock = &dev->lock; dev->vdev.queue = &dev->vb_vidq; dev->vdev.queue->lock = &dev->vb_queue_lock; - strcpy(dev->vdev.name, "au0828a video"); + strscpy(dev->vdev.name, "au0828a video", sizeof(dev->vdev.name)); /* Setup the VBI device */ dev->vbi_dev = au0828_video_template; @@ -1986,7 +1986,7 @@ int au0828_analog_register(struct au0828_dev *dev, dev->vbi_dev.lock = &dev->lock; dev->vbi_dev.queue = &dev->vb_vbiq; dev->vbi_dev.queue->lock = &dev->vb_vbi_queue_lock; - strcpy(dev->vbi_dev.name, "au0828a vbi"); + strscpy(dev->vbi_dev.name, "au0828a vbi", sizeof(dev->vbi_dev.name)); /* Init entities at the Media Controller */ au0828_analog_create_entities(dev); diff --git a/drivers/media/usb/cpia2/cpia2_v4l.c b/drivers/media/usb/cpia2/cpia2_v4l.c index 99f106b13280..aa7f3c307b22 100644 --- a/drivers/media/usb/cpia2/cpia2_v4l.c +++ b/drivers/media/usb/cpia2/cpia2_v4l.c @@ -219,12 +219,12 @@ static int cpia2_querycap(struct file *file, void *fh, struct v4l2_capability *v { struct camera_data *cam = video_drvdata(file); - strcpy(vc->driver, "cpia2"); + strscpy(vc->driver, "cpia2", sizeof(vc->driver)); if (cam->params.pnp_id.product == 0x151) - strcpy(vc->card, "QX5 Microscope"); + strscpy(vc->card, "QX5 Microscope", sizeof(vc->card)); else - strcpy(vc->card, "CPiA2 Camera"); + strscpy(vc->card, "CPiA2 Camera", sizeof(vc->card)); switch (cam->params.pnp_id.device_type) { case DEVICE_STV_672: strcat(vc->card, " (672/"); @@ -281,7 +281,7 @@ static int cpia2_enum_input(struct file *file, void *fh, struct v4l2_input *i) { if (i->index) return -EINVAL; - strcpy(i->name, "Camera"); + strscpy(i->name, "Camera", sizeof(i->name)); i->type = V4L2_INPUT_TYPE_CAMERA; return 0; } @@ -319,11 +319,11 @@ static int cpia2_enum_fmt_vid_cap(struct file *file, void *fh, f->flags = V4L2_FMT_FLAG_COMPRESSED; switch(index) { case 0: - strcpy(f->description, "MJPEG"); + strscpy(f->description, "MJPEG", sizeof(f->description)); f->pixelformat = V4L2_PIX_FMT_MJPEG; break; case 1: - strcpy(f->description, "JPEG"); + strscpy(f->description, "JPEG", sizeof(f->description)); f->pixelformat = V4L2_PIX_FMT_JPEG; break; default: 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"); diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c index 8e799ae1df69..d5e2c19f600d 100644 --- a/drivers/media/usb/em28xx/em28xx-audio.c +++ b/drivers/media/usb/em28xx/em28xx-audio.c @@ -938,11 +938,11 @@ static int em28xx_audio_init(struct em28xx *dev) snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_em28xx_pcm_capture); pcm->info_flags = 0; pcm->private_data = dev; - strcpy(pcm->name, "Empia 28xx Capture"); + strscpy(pcm->name, "Empia 28xx Capture", sizeof(pcm->name)); - strcpy(card->driver, "Em28xx-Audio"); - strcpy(card->shortname, "Em28xx Audio"); - strcpy(card->longname, "Empia Em28xx Audio"); + strscpy(card->driver, "Em28xx-Audio", sizeof(card->driver)); + strscpy(card->shortname, "Em28xx Audio", sizeof(card->shortname)); + strscpy(card->longname, "Empia Em28xx Audio", sizeof(card->longname)); INIT_WORK(&adev->wq_trigger, audio_trigger); diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c index e19d6342e0d0..02c13d71e6c1 100644 --- a/drivers/media/usb/em28xx/em28xx-i2c.c +++ b/drivers/media/usb/em28xx/em28xx-i2c.c @@ -985,7 +985,8 @@ int em28xx_i2c_register(struct em28xx *dev, unsigned int bus, dev->i2c_adap[bus] = em28xx_adap_template; dev->i2c_adap[bus].dev.parent = &dev->intf->dev; - strcpy(dev->i2c_adap[bus].name, dev_name(&dev->intf->dev)); + strscpy(dev->i2c_adap[bus].name, dev_name(&dev->intf->dev), + sizeof(dev->i2c_adap[bus].name)); dev->i2c_bus[bus].bus = bus; dev->i2c_bus[bus].algo_type = algo_type; diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index 5e8a26fa719a..917602954bfb 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c @@ -1675,7 +1675,7 @@ static int vidioc_enum_input(struct file *file, void *priv, i->type = V4L2_INPUT_TYPE_CAMERA; - strcpy(i->name, iname[INPUT(n)->type]); + strscpy(i->name, iname[INPUT(n)->type], sizeof(i->name)); if (INPUT(n)->type == EM28XX_VMUX_TELEVISION) i->type = V4L2_INPUT_TYPE_TUNER; @@ -1716,28 +1716,28 @@ static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a) switch (a->index) { case EM28XX_AMUX_VIDEO: - strcpy(a->name, "Television"); + strscpy(a->name, "Television", sizeof(a->name)); break; case EM28XX_AMUX_LINE_IN: - strcpy(a->name, "Line In"); + strscpy(a->name, "Line In", sizeof(a->name)); break; case EM28XX_AMUX_VIDEO2: - strcpy(a->name, "Television alt"); + strscpy(a->name, "Television alt", sizeof(a->name)); break; case EM28XX_AMUX_PHONE: - strcpy(a->name, "Phone"); + strscpy(a->name, "Phone", sizeof(a->name)); break; case EM28XX_AMUX_MIC: - strcpy(a->name, "Mic"); + strscpy(a->name, "Mic", sizeof(a->name)); break; case EM28XX_AMUX_CD: - strcpy(a->name, "CD"); + strscpy(a->name, "CD", sizeof(a->name)); break; case EM28XX_AMUX_AUX: - strcpy(a->name, "Aux"); + strscpy(a->name, "Aux", sizeof(a->name)); break; case EM28XX_AMUX_PCM_OUT: - strcpy(a->name, "PCM"); + strscpy(a->name, "PCM", sizeof(a->name)); break; default: return -EINVAL; @@ -1776,7 +1776,7 @@ static int vidioc_g_tuner(struct file *file, void *priv, if (t->index != 0) return -EINVAL; - strcpy(t->name, "Tuner"); + strscpy(t->name, "Tuner", sizeof(t->name)); v4l2_device_call_all(&dev->v4l2->v4l2_dev, 0, tuner, g_tuner, t); return 0; @@ -2045,7 +2045,7 @@ static int radio_g_tuner(struct file *file, void *priv, if (unlikely(t->index > 0)) return -EINVAL; - strcpy(t->name, "Radio"); + strscpy(t->name, "Radio", sizeof(t->name)); v4l2_device_call_all(&dev->v4l2->v4l2_dev, 0, tuner, g_tuner, t); diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c index 9ab071f8993d..e082086428a4 100644 --- a/drivers/media/usb/hdpvr/hdpvr-video.c +++ b/drivers/media/usb/hdpvr/hdpvr-video.c @@ -578,8 +578,8 @@ static int vidioc_querycap(struct file *file, void *priv, { struct hdpvr_device *dev = video_drvdata(file); - strcpy(cap->driver, "hdpvr"); - strcpy(cap->card, "Hauppauge HD PVR"); + strscpy(cap->driver, "hdpvr", sizeof(cap->driver)); + strscpy(cap->card, "Hauppauge HD PVR", sizeof(cap->card)); usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info)); cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_AUDIO | V4L2_CAP_READWRITE; @@ -1238,7 +1238,8 @@ int hdpvr_register_videodev(struct hdpvr_device *dev, struct device *parent, /* setup and register video device */ dev->video_dev = hdpvr_video_template; - strcpy(dev->video_dev.name, "Hauppauge HD PVR"); + strscpy(dev->video_dev.name, "Hauppauge HD PVR", + sizeof(dev->video_dev.name)); dev->video_dev.v4l2_dev = &dev->v4l2_dev; video_set_drvdata(&dev->video_dev, dev); diff --git a/drivers/media/usb/pulse8-cec/pulse8-cec.c b/drivers/media/usb/pulse8-cec/pulse8-cec.c index 350635826aae..365c78b748dd 100644 --- a/drivers/media/usb/pulse8-cec/pulse8-cec.c +++ b/drivers/media/usb/pulse8-cec/pulse8-cec.c @@ -571,7 +571,8 @@ static int pulse8_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr) memset(osd_str + osd_len, ' ', 4 - osd_len); osd_len = 4; osd_str[osd_len] = '\0'; - strcpy(adap->log_addrs.osd_name, osd_str); + strscpy(adap->log_addrs.osd_name, osd_str, + sizeof(adap->log_addrs.osd_name)); } err = pulse8_send_and_wait(pulse8, cmd, 1 + osd_len, MSGCODE_COMMAND_ACCEPTED, 0); 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 /* Init video_device structure */ pdev->vdev = pwc_template; - strcpy(pdev->vdev.name, name); + strscpy(pdev->vdev.name, name, sizeof(pdev->vdev.name)); pdev->vdev.queue = &pdev->vb_queue; pdev->vdev.queue->lock = &pdev->vb_queue_lock; 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 { struct pwc_device *pdev = video_drvdata(file); - strcpy(cap->driver, PWC_NAME); + strscpy(cap->driver, PWC_NAME, sizeof(cap->driver)); strscpy(cap->card, pdev->vdev.name, sizeof(cap->card)); usb_make_path(pdev->udev, cap->bus_info, sizeof(cap->bus_info)); cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING | diff --git a/drivers/media/usb/rainshadow-cec/rainshadow-cec.c b/drivers/media/usb/rainshadow-cec/rainshadow-cec.c index cecdcbcd400c..d9964da05976 100644 --- a/drivers/media/usb/rainshadow-cec/rainshadow-cec.c +++ b/drivers/media/usb/rainshadow-cec/rainshadow-cec.c @@ -141,7 +141,8 @@ static void rain_irq_work_handler(struct work_struct *work) !memcmp(rain->cmd, "STA", 3)) { rain_process_msg(rain); } else { - strcpy(rain->cmd_reply, rain->cmd); + strscpy(rain->cmd_reply, rain->cmd, + sizeof(rain->cmd_reply)); complete(&rain->cmd_done); } rain->cmd_idx = 0; diff --git a/drivers/media/usb/stk1160/stk1160-i2c.c b/drivers/media/usb/stk1160/stk1160-i2c.c index 62a12d5356ad..c3a15564e5cb 100644 --- a/drivers/media/usb/stk1160/stk1160-i2c.c +++ b/drivers/media/usb/stk1160/stk1160-i2c.c @@ -260,7 +260,7 @@ int stk1160_i2c_register(struct stk1160 *dev) dev->i2c_adap = adap_template; dev->i2c_adap.dev.parent = dev->dev; - strcpy(dev->i2c_adap.name, "stk1160"); + strscpy(dev->i2c_adap.name, "stk1160", sizeof(dev->i2c_adap.name)); dev->i2c_adap.algo_data = dev; i2c_set_adapdata(&dev->i2c_adap, &dev->v4l2_dev); diff --git a/drivers/media/usb/stk1160/stk1160-v4l.c b/drivers/media/usb/stk1160/stk1160-v4l.c index bbf191b71f38..701ed3d4afe6 100644 --- a/drivers/media/usb/stk1160/stk1160-v4l.c +++ b/drivers/media/usb/stk1160/stk1160-v4l.c @@ -344,8 +344,8 @@ static int vidioc_querycap(struct file *file, { struct stk1160 *dev = video_drvdata(file); - strcpy(cap->driver, "stk1160"); - strcpy(cap->card, "stk1160"); + strscpy(cap->driver, "stk1160", sizeof(cap->driver)); + strscpy(cap->card, "stk1160", sizeof(cap->card)); usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info)); cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c index 5accb5241072..e11d5d5b7c26 100644 --- a/drivers/media/usb/stkwebcam/stk-webcam.c +++ b/drivers/media/usb/stkwebcam/stk-webcam.c @@ -793,8 +793,8 @@ static int stk_vidioc_querycap(struct file *filp, { struct stk_camera *dev = video_drvdata(filp); - strcpy(cap->driver, "stk"); - strcpy(cap->card, "stk"); + strscpy(cap->driver, "stk", sizeof(cap->driver)); + strscpy(cap->card, "stk", sizeof(cap->card)); usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info)); cap->device_caps = V4L2_CAP_VIDEO_CAPTURE @@ -809,7 +809,7 @@ static int stk_vidioc_enum_input(struct file *filp, if (input->index != 0) return -EINVAL; - strcpy(input->name, "Syntek USB Camera"); + strscpy(input->name, "Syntek USB Camera", sizeof(input->name)); input->type = V4L2_INPUT_TYPE_CAMERA; return 0; } @@ -859,23 +859,23 @@ static int stk_vidioc_enum_fmt_vid_cap(struct file *filp, switch (fmtd->index) { case 0: fmtd->pixelformat = V4L2_PIX_FMT_RGB565; - strcpy(fmtd->description, "r5g6b5"); + strscpy(fmtd->description, "r5g6b5", sizeof(fmtd->description)); break; case 1: fmtd->pixelformat = V4L2_PIX_FMT_RGB565X; - strcpy(fmtd->description, "r5g6b5BE"); + strscpy(fmtd->description, "r5g6b5BE", sizeof(fmtd->description)); break; case 2: fmtd->pixelformat = V4L2_PIX_FMT_UYVY; - strcpy(fmtd->description, "yuv4:2:2"); + strscpy(fmtd->description, "yuv4:2:2", sizeof(fmtd->description)); break; case 3: fmtd->pixelformat = V4L2_PIX_FMT_SBGGR8; - strcpy(fmtd->description, "Raw bayer"); + strscpy(fmtd->description, "Raw bayer", sizeof(fmtd->description)); break; case 4: fmtd->pixelformat = V4L2_PIX_FMT_YUYV; - strcpy(fmtd->description, "yuv4:2:2"); + strscpy(fmtd->description, "yuv4:2:2", sizeof(fmtd->description)); break; default: return -EINVAL; diff --git a/drivers/media/usb/tm6000/tm6000-alsa.c b/drivers/media/usb/tm6000/tm6000-alsa.c index f18cffae4c85..b965931793b5 100644 --- a/drivers/media/usb/tm6000/tm6000-alsa.c +++ b/drivers/media/usb/tm6000/tm6000-alsa.c @@ -429,8 +429,8 @@ static int tm6000_audio_init(struct tm6000_core *dev) snd_printk(KERN_ERR "cannot create card instance %d\n", devnr); return rc; } - strcpy(card->driver, "tm6000-alsa"); - strcpy(card->shortname, "TM5600/60x0"); + strscpy(card->driver, "tm6000-alsa", sizeof(card->driver)); + strscpy(card->shortname, "TM5600/60x0", sizeof(card->shortname)); sprintf(card->longname, "TM5600/60x0 Audio at bus %d device %d", dev->udev->bus->busnum, dev->udev->devnum); @@ -456,7 +456,7 @@ static int tm6000_audio_init(struct tm6000_core *dev) pcm->info_flags = 0; pcm->private_data = chip; - strcpy(pcm->name, "Trident TM5600/60x0"); + strscpy(pcm->name, "Trident TM5600/60x0", sizeof(pcm->name)); snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_tm6000_pcm_ops); diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c index f3082bd44ce6..49d7eb0c4cbf 100644 --- a/drivers/media/usb/tm6000/tm6000-video.c +++ b/drivers/media/usb/tm6000/tm6000-video.c @@ -1091,7 +1091,7 @@ static int vidioc_enum_input(struct file *file, void *priv, else i->type = V4L2_INPUT_TYPE_CAMERA; - strcpy(i->name, iname[dev->vinput[n].type]); + strscpy(i->name, iname[dev->vinput[n].type], sizeof(i->name)); i->std = TM6000_STD; @@ -1188,7 +1188,7 @@ static int vidioc_g_tuner(struct file *file, void *priv, if (0 != t->index) return -EINVAL; - strcpy(t->name, "Television"); + strscpy(t->name, "Television", sizeof(t->name)); t->type = V4L2_TUNER_ANALOG_TV; t->capability = V4L2_TUNER_CAP_NORM | V4L2_TUNER_CAP_STEREO; t->rangehigh = 0xffffffffUL; @@ -1268,7 +1268,7 @@ static int radio_g_tuner(struct file *file, void *priv, return -EINVAL; memset(t, 0, sizeof(*t)); - strcpy(t->name, "Radio"); + strscpy(t->name, "Radio", sizeof(t->name)); t->type = V4L2_TUNER_RADIO; t->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO; t->rxsubchans = V4L2_TUNER_SUB_STEREO; diff --git a/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c index eed56895c2b9..6eb84cf007b4 100644 --- a/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c +++ b/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c @@ -1686,7 +1686,7 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i /* i2c */ memset(&ttusb->i2c_adap, 0, sizeof(struct i2c_adapter)); - strcpy(ttusb->i2c_adap.name, "TTUSB DEC"); + strscpy(ttusb->i2c_adap.name, "TTUSB DEC", sizeof(ttusb->i2c_adap.name)); i2c_set_adapdata(&ttusb->i2c_adap, ttusb); 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; } diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index 3aa809af5ea7..bc369a0934a3 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -2132,7 +2132,7 @@ static int uvc_probe(struct usb_interface *intf, if (udev->serial) strscpy(dev->mdev.serial, udev->serial, sizeof(dev->mdev.serial)); - strcpy(dev->mdev.bus_info, udev->devpath); + strscpy(dev->mdev.bus_info, udev->devpath, sizeof(dev->mdev.bus_info)); dev->mdev.hw_revision = le16_to_cpu(udev->descriptor.bcdDevice); media_device_init(&dev->mdev); diff --git a/drivers/media/usb/zr364xx/zr364xx.c b/drivers/media/usb/zr364xx/zr364xx.c index 0ba98583c736..ab35554cbffa 100644 --- a/drivers/media/usb/zr364xx/zr364xx.c +++ b/drivers/media/usb/zr364xx/zr364xx.c @@ -719,7 +719,7 @@ static int zr364xx_vidioc_enum_input(struct file *file, void *priv, { if (i->index != 0) return -EINVAL; - strcpy(i->name, DRIVER_DESC " Camera"); + strscpy(i->name, DRIVER_DESC " Camera", sizeof(i->name)); i->type = V4L2_INPUT_TYPE_CAMERA; return 0; } @@ -765,7 +765,7 @@ static int zr364xx_vidioc_enum_fmt_vid_cap(struct file *file, if (f->index > 0) return -EINVAL; f->flags = V4L2_FMT_FLAG_COMPRESSED; - strcpy(f->description, formats[0].name); + strscpy(f->description, formats[0].name, sizeof(f->description)); f->pixelformat = formats[0].fourcc; return 0; } |