Use only strscpy() for string copy
Subsystems (93)
PATCH 2/3 media: replace strcpy() by strscpy()
In reply to Mauro Carvalho ChehabThe strcpy() function is being deprecated upstream. Replace it by the safer strscpy().
--- drivers/media/common/saa7146/saa7146_video.c | 2 +- drivers/media/dvb-core/dvb_frontend.c | 2 +- drivers/media/dvb-frontends/mt312.c | 9 ++++--- drivers/media/dvb-frontends/zl10039.c | 5 ++-- drivers/media/firewire/firedtv-fe.c | 2 +- drivers/media/i2c/ad5820.c | 2 +- drivers/media/i2c/lm3560.c | 3 ++- drivers/media/i2c/lm3646.c | 3 ++- drivers/media/i2c/s5c73m3/s5c73m3-core.c | 2 +- drivers/media/i2c/sr030pc30.c | 2 +- drivers/media/pci/bt8xx/bttv-driver.c | 4 +-- drivers/media/pci/cx23885/cx23885-417.c | 2 +- drivers/media/pci/cx23885/cx23885-alsa.c | 4 +-- drivers/media/pci/cx23885/cx23885-video.c | 11 ++++---- drivers/media/pci/cx25821/cx25821-alsa.c | 8 +++--- drivers/media/pci/cx25821/cx25821-video.c | 6 ++--- drivers/media/pci/cx88/cx88-alsa.c | 6 ++--- drivers/media/pci/cx88/cx88-blackbird.c | 4 +-- drivers/media/pci/cx88/cx88-cards.c | 2 +- drivers/media/pci/cx88/cx88-video.c | 8 +++--- drivers/media/pci/dm1105/dm1105.c | 5 ++-- drivers/media/pci/dt3155/dt3155.c | 6 ++--- drivers/media/pci/meye/meye.c | 10 ++++---- drivers/media/pci/ngene/ngene-i2c.c | 2 +- drivers/media/pci/pluto2/pluto2.c | 3 ++- drivers/media/pci/pt1/pt1.c | 2 +- drivers/media/pci/saa7134/saa7134-alsa.c | 8 +++--- drivers/media/pci/saa7134/saa7134-i2c.c | 2 +- drivers/media/pci/saa7134/saa7134-video.c | 9 ++++--- drivers/media/pci/saa7164/saa7164-core.c | 2 +- drivers/media/pci/saa7164/saa7164-encoder.c | 6 ++--- drivers/media/pci/saa7164/saa7164-vbi.c | 2 +- drivers/media/pci/smipcie/smipcie-main.c | 4 +-- drivers/media/pci/solo6x10/solo6x10-g723.c | 8 +++--- .../media/pci/solo6x10/solo6x10-v4l2-enc.c | 13 ++++++---- drivers/media/pci/solo6x10/solo6x10-v4l2.c | 4 +-- drivers/media/pci/sta2x11/sta2x11_vip.c | 6 ++--- drivers/media/pci/ttpci/av7110_v4l.c | 2 +- drivers/media/pci/ttpci/budget-core.c | 3 ++- drivers/media/pci/tw5864/tw5864-video.c | 2 +- drivers/media/pci/tw68/tw68-video.c | 2 +- drivers/media/platform/am437x/am437x-vpfe.c | 3 ++- drivers/media/platform/atmel/atmel-isc.c | 6 ++--- drivers/media/platform/davinci/vpbe_display.c | 6 +++-- drivers/media/platform/davinci/vpbe_venc.c | 2 +- drivers/media/platform/davinci/vpif_capture.c | 6 +++-- drivers/media/platform/davinci/vpif_display.c | 3 ++- drivers/media/platform/fsl-viu.c | 8 +++--- .../media/platform/marvell-ccic/cafe-driver.c | 2 +- .../media/platform/marvell-ccic/mcam-core.c | 6 ++--- .../media/platform/soc_camera/soc_camera.c | 2 +- drivers/media/platform/via-camera.c | 6 ++--- drivers/media/platform/vivid/vivid-cec.c | 4 +-- drivers/media/platform/vivid/vivid-core.c | 4 +-- drivers/media/radio/dsbr100.c | 2 +- drivers/media/radio/radio-ma901.c | 2 +- drivers/media/radio/radio-mr800.c | 2 +- .../media/radio/si470x/radio-si470x-common.c | 2 +- drivers/media/radio/wl128x/fmdrv_v4l2.c | 4 +-- drivers/media/rc/imon.c | 4 +-- drivers/media/usb/au0828/au0828-video.c | 18 ++++++------- drivers/media/usb/cpia2/cpia2_v4l.c | 12 ++++----- drivers/media/usb/cx231xx/cx231xx-audio.c | 9 ++++--- drivers/media/usb/cx231xx/cx231xx-video.c | 9 ++++--- drivers/media/usb/em28xx/em28xx-audio.c | 8 +++--- drivers/media/usb/em28xx/em28xx-i2c.c | 3 ++- drivers/media/usb/em28xx/em28xx-video.c | 22 ++++++++-------- drivers/media/usb/hdpvr/hdpvr-video.c | 7 +++--- drivers/media/usb/pulse8-cec/pulse8-cec.c | 3 ++- drivers/media/usb/pwc/pwc-if.c | 2 +- drivers/media/usb/pwc/pwc-v4l.c | 2 +- .../media/usb/rainshadow-cec/rainshadow-cec.c | 3 ++- drivers/media/usb/stk1160/stk1160-i2c.c | 2 +- drivers/media/usb/stk1160/stk1160-v4l.c | 4 +-- drivers/media/usb/stkwebcam/stk-webcam.c | 21 ++++++++++------ drivers/media/usb/tm6000/tm6000-alsa.c | 6 ++--- drivers/media/usb/tm6000/tm6000-video.c | 6 ++--- .../media/usb/ttusb-budget/dvb-ttusb-budget.c | 3 ++- drivers/media/usb/usbvision/usbvision-video.c | 25 +++++++++++-------- drivers/media/usb/uvc/uvc_driver.c | 2 +- drivers/media/usb/zr364xx/zr364xx.c | 4 +-- .../media/davinci_vpfe/vpfe_mc_capture.c | 3 ++- drivers/staging/media/imx/imx6-mipi-csi2.c | 2 +- drivers/staging/media/zoran/zoran_card.c | 3 ++- 84 files changed, 240 insertions(+), 201 deletions(-)
drivers/media/common/saa7146/saa7146_video.c +1 -1
@@ -451,7 +451,7 @@ static int vidioc_querycap(struct file *file, void *fh, struct v4l2_capability *struct video_device *vdev =video_devdata (file);struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -strcpy ((char *)cap->driver,"saa7146 v4l2" ); +strscpy ((char *)cap->driver,"saa7146 v4l2" ,sizeof (cap->driver));strscpy ((char *)cap->card, dev->ext->name,sizeof (cap->card));sprintf ((char *)cap->bus_info,"PCI:%s" ,pci_name (dev->pci)); cap->device_caps =
drivers/media/dvb-core/dvb_frontend.c +1 -1
@@ -2422,7 +2422,7 @@ static int dvb_frontend_handle_ioctl(struct file *file,struct dvb_frontend_info *info = parg;memset (info,0 ,sizeof (*info)); -strcpy (info->name, fe->ops.info.name); +strscpy (info->name, fe->ops.info.name,sizeof (info->name)); info->symbol_rate_min = fe->ops.info.symbol_rate_min; info->symbol_rate_max = fe->ops.info.symbol_rate_max; info->symbol_rate_tolerance = fe->ops.info.symbol_rate_tolerance;
drivers/media/dvb-frontends/mt312.c +6 -3
@@ -815,17 +815,20 @@ struct dvb_frontend *mt312_attach(const struct mt312_config *config,switch (state->id) {case ID_VP310 : -strcpy (state->frontend.ops.info.name,"Zarlink VP310 DVB-S" ); +strscpy (state->frontend.ops.info.name,"Zarlink VP310 DVB-S" , +sizeof (state->frontend.ops.info.name)); state->xtal =MT312_PLL_CLK ; state->freq_mult =9 ;break ;case ID_MT312 : -strcpy (state->frontend.ops.info.name,"Zarlink MT312 DVB-S" ); +strscpy (state->frontend.ops.info.name,"Zarlink MT312 DVB-S" , +sizeof (state->frontend.ops.info.name)); state->xtal =MT312_PLL_CLK ; state->freq_mult =6 ;break ;case ID_ZL10313 : -strcpy (state->frontend.ops.info.name,"Zarlink ZL10313 DVB-S" ); +strscpy (state->frontend.ops.info.name,"Zarlink ZL10313 DVB-S" , +sizeof (state->frontend.ops.info.name)); state->xtal =MT312_PLL_CLK_10_111 ; state->freq_mult =9 ;break ;
drivers/media/dvb-frontends/zl10039.c +3 -2
@@ -288,8 +288,9 @@ struct dvb_frontend *zl10039_attach(struct dvb_frontend *fe, state->id = state->id &0x0f ;switch (state->id) {case ID_ZL10039 : -strcpy (fe->ops.tuner_ops.info.name, -"Zarlink ZL10039 DVB-S tuner" ); +strscpy (fe->ops.tuner_ops.info.name, +"Zarlink ZL10039 DVB-S tuner" , +sizeof (fe->ops.tuner_ops.info.name));break ;default :dprintk ("Chip ID=%x does not match a known type\n" , state->id);
drivers/media/firewire/firedtv-fe.c +1 -1
@@ -247,7 +247,7 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name)dev_err (fdtv->device,"no frontend for model type %d\n" , fdtv->type); } -strcpy (fi->name, name); +strscpy (fi->name, name,sizeof (fi->name)); fdtv->fe.dvb = &fdtv->adapter; fdtv->fe.sec_priv = fdtv;
drivers/media/i2c/ad5820.c +1 -1
@@ -317,7 +317,7 @@ static int ad5820_probe(struct i2c_client *client,v4l2_i2c_subdev_init (&coil->subdev, client, &ad5820_ops); coil->subdev.flags |=V4L2_SUBDEV_FL_HAS_DEVNODE ; coil->subdev.internal_ops = &ad5820_internal_ops; -strcpy (coil->subdev.name,"ad5820 focus" ); +strscpy (coil->subdev.name,"ad5820 focus" ,sizeof (coil->subdev.name)); ret =media_entity_pads_init (&coil->subdev.entity,0 ,NULL );if (ret <0 )
drivers/media/i2c/lm3560.c +2 -1
@@ -362,7 +362,8 @@ static int lm3560_subdev_init(struct lm3560_flash *flash,v4l2_i2c_subdev_init (&flash->subdev_led[led_no], client, &lm3560_ops); flash->subdev_led[led_no].flags |=V4L2_SUBDEV_FL_HAS_DEVNODE ; -strcpy (flash->subdev_led[led_no].name, led_name); +strscpy (flash->subdev_led[led_no].name, led_name, +sizeof (flash->subdev_led[led_no].name)); rval =lm3560_init_controls (flash, led_no);if (rval) goto err_out;
drivers/media/i2c/lm3646.c +2 -1
@@ -278,7 +278,8 @@ static int lm3646_subdev_init(struct lm3646_flash *flash)v4l2_i2c_subdev_init (&flash->subdev_led, client, &lm3646_ops); flash->subdev_led.flags |=V4L2_SUBDEV_FL_HAS_DEVNODE ; -strcpy (flash->subdev_led.name,LM3646_NAME ); +strscpy (flash->subdev_led.name,LM3646_NAME , +sizeof (flash->subdev_led.name)); rval =lm3646_init_controls (flash);if (rval) goto err_out;
drivers/media/i2c/s5c73m3/s5c73m3-core.c +1 -1
@@ -1698,7 +1698,7 @@ static int s5c73m3_probe(struct i2c_client *client,return ret;v4l2_i2c_subdev_init (oif_sd, client, &oif_subdev_ops); -strcpy (oif_sd->name,"S5C73M3-OIF" ); +strscpy (oif_sd->name,"S5C73M3-OIF" ,sizeof (oif_sd->name)); oif_sd->internal_ops = &oif_internal_ops; oif_sd->flags |=V4L2_SUBDEV_FL_HAS_DEVNODE ;
drivers/media/i2c/sr030pc30.c +1 -1
@@ -703,7 +703,7 @@ static int sr030pc30_probe(struct i2c_client *client,return -ENOMEM ; sd = &info->sd; -strcpy (sd->name,MODULE_NAME ); +strscpy (sd->name,MODULE_NAME ,sizeof (sd->name)); info->pdata = client->dev.platform_data;v4l2_i2c_subdev_init (sd, client, &sr030pc30_ops);
drivers/media/pci/bt8xx/bttv-driver.c +2 -2
@@ -2782,7 +2782,7 @@ static int bttv_g_tuner(struct file *file, void *priv, t->rxsubchans =V4L2_TUNER_SUB_MONO ; t->capability =V4L2_TUNER_CAP_NORM ;bttv_call_all (btv, tuner, g_tuner, t); -strcpy (t->name,"Television" ); +strscpy (t->name,"Television" ,sizeof (t->name)); t->type =V4L2_TUNER_ANALOG_TV ;if (btread (BT848_DSTATUS )&BT848_DSTATUS_HLOC ) t->signal =0xffff ;
@@ -3257,7 +3257,7 @@ static int radio_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)if (0 != t->index)return -EINVAL ; -strcpy (t->name,"Radio" ); +strscpy (t->name,"Radio" ,sizeof (t->name)); t->type =V4L2_TUNER_RADIO ;radio_enable (btv);
drivers/media/pci/cx23885/cx23885-417.c +1 -1
@@ -1280,7 +1280,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,return -EINVAL ;if (0 != t->index)return -EINVAL ; -strcpy (t->name,"Television" ); +strscpy (t->name,"Television" ,sizeof (t->name));call_all (dev, tuner, g_tuner, t);dprintk (1 ,"VIDIOC_G_TUNER: tuner type %d\n" , t->type);
drivers/media/pci/cx23885/cx23885-alsa.c +2 -2
@@ -526,7 +526,7 @@ static int snd_cx23885_pcm(struct cx23885_audio_dev *chip, int device,if (err <0 )return err; pcm->private_data = chip; -strcpy (pcm->name, name); +strscpy (pcm->name, name,sizeof (pcm->name));snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_cx23885_pcm_ops);return 0 ;
@@ -571,7 +571,7 @@ struct cx23885_audio_dev *cx23885_audio_register(struct cx23885_dev *dev)if (err <0 ) goto error; -strcpy (card->driver,"CX23885" ); +strscpy (card->driver,"CX23885" ,sizeof (card->driver));sprintf (card->shortname,"Conexant CX23885" );sprintf (card->longname,"%s at %s" , card->shortname, dev->name);
drivers/media/pci/cx23885/cx23885-video.c +6 -5
@@ -639,7 +639,7 @@ static int vidioc_querycap(struct file *file, void *priv,struct cx23885_dev *dev =video_drvdata (file);struct video_device *vdev =video_devdata (file); -strcpy (cap->driver,"cx23885" ); +strscpy (cap->driver,"cx23885" ,sizeof (cap->driver));strscpy (cap->card, cx23885_boards[dev->board].name,sizeof (cap->card));sprintf (cap->bus_info,"PCIe:%s" ,pci_name (dev->pci));
@@ -731,7 +731,7 @@ int cx23885_enum_input(struct cx23885_dev *dev, struct v4l2_input *i) 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)); i->std =CX23885_NORMS ;if ((CX23885_VMUX_TELEVISION ==INPUT (n)->type) || (CX23885_VMUX_CABLE ==INPUT (n)->type)) {
@@ -828,7 +828,7 @@ static int cx23885_query_audinput(struct file *file, void *priv,memset (i,0 ,sizeof (*i)); i->index = n; -strcpy (i->name, iname[n]); +strscpy (i->name, iname[n],sizeof (i->name)); i->capability =V4L2_AUDCAP_STEREO ;return 0 ;
@@ -887,7 +887,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));call_all (dev, tuner, g_tuner, t);return 0 ;
@@ -1186,7 +1186,8 @@ int cx23885_video_register(struct cx23885_dev *dev)/* Initialize VBI template */ cx23885_vbi_template = cx23885_video_template; -strcpy (cx23885_vbi_template.name,"cx23885-vbi" ); +strscpy (cx23885_vbi_template.name,"cx23885-vbi" , +sizeof (cx23885_vbi_template.name)); dev->tvnorm =V4L2_STD_NTSC_M ; dev->fmt =format_by_fourcc (V4L2_PIX_FMT_YUYV );
drivers/media/pci/cx25821/cx25821-alsa.c +4 -4
@@ -674,7 +674,7 @@ static int snd_cx25821_pcm(struct cx25821_audio_dev *chip, int device, } pcm->private_data = chip; pcm->info_flags =0 ; -strcpy (pcm->name, name); +strscpy (pcm->name, name,sizeof (pcm->name));snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_cx25821_pcm_ops);return 0 ;
@@ -725,7 +725,7 @@ static int cx25821_audio_initdev(struct cx25821_dev *dev)return err; } -strcpy (card->driver,"cx25821" ); +strscpy (card->driver,"cx25821" ,sizeof (card->driver));/* Card "creation" */ chip = card->private_data;
@@ -754,10 +754,10 @@ static int cx25821_audio_initdev(struct cx25821_dev *dev) goto error; } -strcpy (card->shortname,"cx25821" ); +strscpy (card->shortname,"cx25821" ,sizeof (card->shortname));sprintf (card->longname,"%s at 0x%lx irq %d" , chip->dev->name, chip->iobase, chip->irq); -strcpy (card->mixername,"CX25821" ); +strscpy (card->mixername,"CX25821" ,sizeof (card->mixername));pr_info ("%s/%i: ALSA support for cx25821 boards\n" , card->driver, devno);
drivers/media/pci/cx25821/cx25821-video.c +3 -3
@@ -441,7 +441,7 @@ static int cx25821_vidioc_querycap(struct file *file, void *priv,V4L2_CAP_READWRITE |V4L2_CAP_STREAMING ;const u32 cap_output =V4L2_CAP_VIDEO_OUTPUT |V4L2_CAP_READWRITE ; -strcpy (cap->driver,"cx25821" ); +strscpy (cap->driver,"cx25821" ,sizeof (cap->driver));strscpy (cap->card, cx25821_boards[dev->board].name,sizeof (cap->card));sprintf (cap->bus_info,"PCIe:%s" ,pci_name (dev->pci));if (chan->id >=VID_CHANNEL_NUM )
@@ -486,7 +486,7 @@ static int cx25821_vidioc_enum_input(struct file *file, void *priv, i->type =V4L2_INPUT_TYPE_CAMERA ; i->std =CX25821_NORMS ; -strcpy (i->name,"Composite" ); +strscpy (i->name,"Composite" ,sizeof (i->name));return 0 ; }
@@ -534,7 +534,7 @@ static int cx25821_vidioc_enum_output(struct file *file, void *priv, o->type =V4L2_INPUT_TYPE_CAMERA ; o->std =CX25821_NORMS ; -strcpy (o->name,"Composite" ); +strscpy (o->name,"Composite" ,sizeof (o->name));return 0 ; }
drivers/media/pci/cx88/cx88-alsa.c +3 -3
@@ -616,7 +616,7 @@ static int snd_cx88_pcm(struct cx88_audio_dev *chip, int device,if (err <0 )return err; pcm->private_data = chip; -strcpy (pcm->name, name); +strscpy (pcm->name, name,sizeof (pcm->name));snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_cx88_pcm_ops);return 0 ;
@@ -968,12 +968,12 @@ static int cx88_audio_initdev(struct pci_dev *pci, goto error; } -strcpy (card->driver,"CX88x" ); +strscpy (card->driver,"CX88x" ,sizeof (card->driver));sprintf (card->shortname,"Conexant CX%x" , pci->device);sprintf (card->longname,"%s at %#llx" , card->shortname, (unsigned long long )pci_resource_start (pci,0 )); -strcpy (card->mixername,"CX88" ); +strscpy (card->mixername,"CX88" ,sizeof (card->mixername));dprintk (0 ,"%s/%i: ALSA support for cx2388x boards\n" , card->driver, devno);
drivers/media/pci/cx88/cx88-blackbird.c +2 -2
@@ -803,7 +803,7 @@ static int vidioc_querycap(struct file *file, void *priv,struct cx8802_dev *dev =video_drvdata (file);struct cx88_core *core = dev->core; -strcpy (cap->driver,"cx88_blackbird" ); +strscpy (cap->driver,"cx88_blackbird" ,sizeof (cap->driver));sprintf (cap->bus_info,"PCI:%s" ,pci_name (dev->pci));return cx88_querycap (file, core, cap); }
@@ -995,7 +995,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,if (t->index !=0 )return -EINVAL ; -strcpy (t->name,"Television" ); +strscpy (t->name,"Television" ,sizeof (t->name)); t->capability =V4L2_TUNER_CAP_NORM ; t->rangehigh =0xffffffffUL ;call_all (core, tuner, g_tuner, t);
drivers/media/pci/cx88/cx88-cards.c +1 -1
@@ -3693,7 +3693,7 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr) core->height =240 ; core->field =V4L2_FIELD_INTERLACED ; -strcpy (core->v4l2_dev.name, core->name); +strscpy (core->v4l2_dev.name, core->name,sizeof (core->v4l2_dev.name));if (v4l2_device_register (NULL , &core->v4l2_dev)) {kfree (core);return NULL ;
drivers/media/pci/cx88/cx88-video.c +4 -4
@@ -842,7 +842,7 @@ static int vidioc_querycap(struct file *file, void *priv,struct cx8800_dev *dev =video_drvdata (file);struct cx88_core *core = dev->core; -strcpy (cap->driver,"cx8800" ); +strscpy (cap->driver,"cx8800" ,sizeof (cap->driver));sprintf (cap->bus_info,"PCI:%s" ,pci_name (dev->pci));return cx88_querycap (file, core, cap); }
@@ -897,7 +897,7 @@ int cx88_enum_input(struct cx88_core *core, struct v4l2_input *i)if (!INPUT (n).type)return -EINVAL ; 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 ==CX88_VMUX_TELEVISION ) || (INPUT (n).type ==CX88_VMUX_CABLE )) i->type =V4L2_INPUT_TYPE_TUNER ;
@@ -952,7 +952,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,if (t->index !=0 )return -EINVAL ; -strcpy (t->name,"Television" ); +strscpy (t->name,"Television" ,sizeof (t->name)); t->capability =V4L2_TUNER_CAP_NORM ; t->rangehigh =0xffffffffUL ;call_all (core, tuner, g_tuner, t);
@@ -1065,7 +1065,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));call_all (core, tuner, g_tuner, t);return 0 ;
drivers/media/pci/dm1105/dm1105.c +3 -2
@@ -1046,7 +1046,7 @@ static int dm1105_probe(struct pci_dev *pdev,/* i2c */ i2c_set_adapdata (&dev->i2c_adap, dev); -strcpy (dev->i2c_adap.name,DRIVER_NAME ); +strscpy (dev->i2c_adap.name,DRIVER_NAME ,sizeof (dev->i2c_adap.name)); dev->i2c_adap.owner =THIS_MODULE ; dev->i2c_adap.dev.parent = &pdev->dev; dev->i2c_adap.algo = &dm1105_algo;
@@ -1057,7 +1057,8 @@ static int dm1105_probe(struct pci_dev *pdev, goto err_dm1105_hw_exit;i2c_set_adapdata (&dev->i2c_bb_adap, dev); -strcpy (dev->i2c_bb_adap.name,DM1105_I2C_GPIO_NAME ); +strscpy (dev->i2c_bb_adap.name,DM1105_I2C_GPIO_NAME , +sizeof (dev->i2c_bb_adap.name)); dev->i2c_bb_adap.owner =THIS_MODULE ; dev->i2c_bb_adap.dev.parent = &pdev->dev; dev->i2c_bb_adap.algo_data = &dev->i2c_bit;
drivers/media/pci/dt3155/dt3155.c +3 -3
@@ -307,8 +307,8 @@ static int dt3155_querycap(struct file *filp, void *p, {struct dt3155_priv *pd =video_drvdata (filp); -strcpy (cap->driver,DT3155_NAME ); -strcpy (cap->card,DT3155_NAME " frame grabber" ); +strscpy (cap->driver,DT3155_NAME ,sizeof (cap->driver)); +strscpy (cap->card,DT3155_NAME " frame grabber" ,sizeof (cap->card));sprintf (cap->bus_info,"PCI:%s" ,pci_name (pd->pdev)); cap->device_caps =V4L2_CAP_VIDEO_CAPTURE |V4L2_CAP_STREAMING |V4L2_CAP_READWRITE ;
@@ -322,7 +322,7 @@ static int dt3155_enum_fmt_vid_cap(struct file *filp,if (f->index)return -EINVAL ; f->pixelformat =V4L2_PIX_FMT_GREY ; -strcpy (f->description,"8-bit Greyscale" ); +strscpy (f->description,"8-bit Greyscale" ,sizeof (f->description));return 0 ; }
drivers/media/pci/meye/meye.c +5 -5
@@ -1019,8 +1019,8 @@ static int meyeioc_stilljcapt(int *len)static int vidioc_querycap (struct file *file,void *fh,struct v4l2_capability *cap) { -strcpy (cap->driver,"meye" ); -strcpy (cap->card,"meye" ); +strscpy (cap->driver,"meye" ,sizeof (cap->driver)); +strscpy (cap->card,"meye" ,sizeof (cap->card));sprintf (cap->bus_info,"PCI:%s" ,pci_name (meye.mchip_dev)); cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
@@ -1035,7 +1035,7 @@ static int vidioc_enum_input(struct file *file, void *fh, struct v4l2_input *i)if (i->index !=0 )return -EINVAL ; -strcpy (i->name,"Camera" ); +strscpy (i->name,"Camera" ,sizeof (i->name)); i->type =V4L2_INPUT_TYPE_CAMERA ;return 0 ;
@@ -1118,12 +1118,12 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *fh,if (f->index ==0 ) {/* standard YUV 422 capture */ f->flags =0 ; -strcpy (f->description,"YUV422" ); +strscpy (f->description,"YUV422" ,sizeof (f->description)); f->pixelformat =V4L2_PIX_FMT_YUYV ; }else {/* compressed MJPEG capture */ f->flags =V4L2_FMT_FLAG_COMPRESSED ; -strcpy (f->description,"MJPEG" ); +strscpy (f->description,"MJPEG" ,sizeof (f->description)); f->pixelformat =V4L2_PIX_FMT_MJPEG ; }
drivers/media/pci/ngene/ngene-i2c.c +1 -1
@@ -161,7 +161,7 @@ int ngene_i2c_init(struct ngene *dev, int dev_nr)i2c_set_adapdata (adap, &(dev->channel[dev_nr])); -strcpy (adap->name,"nGene" ); +strscpy (adap->name,"nGene" ,sizeof (adap->name)); adap->algo = &ngene_i2c_algo; adap->algo_data = (void *)&(dev->channel[dev_nr]);
drivers/media/pci/pluto2/pluto2.c +2 -1
@@ -633,7 +633,8 @@ static int pluto2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)/* i2c */ i2c_set_adapdata (&pluto->i2c_adap, pluto); -strcpy (pluto->i2c_adap.name,DRIVER_NAME ); +strscpy (pluto->i2c_adap.name,DRIVER_NAME , +sizeof (pluto->i2c_adap.name)); pluto->i2c_adap.owner =THIS_MODULE ; pluto->i2c_adap.dev.parent = &pdev->dev; pluto->i2c_adap.algo_data = &pluto->i2c_bit;
drivers/media/pci/pt1/pt1.c +1 -1
@@ -1354,7 +1354,7 @@ static int pt1_probe(struct pci_dev *pdev, const struct pci_device_id *ent) i2c_adap->algo = &pt1_i2c_algo; i2c_adap->algo_data =NULL ; i2c_adap->dev.parent = &pdev->dev; -strcpy (i2c_adap->name,DRIVER_NAME ); +strscpy (i2c_adap->name,DRIVER_NAME ,sizeof (i2c_adap->name));i2c_set_adapdata (i2c_adap, pt1); ret =i2c_add_adapter (i2c_adap);if (ret <0 )
drivers/media/pci/saa7134/saa7134-alsa.c +4 -4
@@ -901,7 +901,7 @@ static int snd_card_saa7134_pcm(snd_card_saa7134_t *saa7134, int device)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_card_saa7134_capture_ops); pcm->private_data = saa7134; pcm->info_flags =0 ; -strcpy (pcm->name,"SAA7134 PCM" ); +strscpy (pcm->name,"SAA7134 PCM" ,sizeof (pcm->name));return 0 ; }
@@ -1074,7 +1074,7 @@ static int snd_card_saa7134_new_mixer(snd_card_saa7134_t * chip)unsigned int idx;int err, addr; -strcpy (card->mixername,"SAA7134 Mixer" ); +strscpy (card->mixername,"SAA7134 Mixer" ,sizeof (card->mixername));for (idx =0 ; idx <ARRAY_SIZE (snd_saa7134_volume_controls); idx++) { kcontrol = snd_ctl_new1(&snd_saa7134_volume_controls[idx],
@@ -1138,7 +1138,7 @@ static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum)if (err <0 )return err; -strcpy (card->driver,"SAA7134" ); +strscpy (card->driver,"SAA7134" ,sizeof (card->driver));/* Card "creation" */
@@ -1178,7 +1178,7 @@ static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum)/* End of "creation" */ -strcpy (card->shortname,"SAA7134" ); +strscpy (card->shortname,"SAA7134" ,sizeof (card->shortname));sprintf (card->longname,"%s at 0x%lx irq %d" , chip->dev->name, chip->iobase, chip->irq);
drivers/media/pci/saa7134/saa7134-i2c.c +1 -1
@@ -437,7 +437,7 @@ int saa7134_i2c_register(struct saa7134_dev *dev) { dev->i2c_adap = saa7134_adap_template; dev->i2c_adap.dev.parent = &dev->pci->dev; -strcpy (dev->i2c_adap.name,dev->name); +strscpy (dev->i2c_adap.name, dev->name,sizeof (dev->i2c_adap.name)); dev->i2c_adap.algo_data = dev;i2c_set_adapdata (&dev->i2c_adap, &dev->v4l2_dev);i2c_add_adapter (&dev->i2c_adap);
drivers/media/pci/saa7134/saa7134-video.c +5 -4
@@ -1445,7 +1445,8 @@ int saa7134_enum_input(struct file *file, void *priv, struct v4l2_input *i)if (card_in (dev, i->index).type ==SAA7134_NO_INPUT )return -EINVAL ; i->index = n; -strcpy (i->name, saa7134_input_name[card_in (dev, n).type]); +strscpy (i->name, saa7134_input_name[card_in (dev, n).type], +sizeof (i->name));switch (card_in (dev, n).type) {case SAA7134_INPUT_TV :case SAA7134_INPUT_TV_MONO :
@@ -1502,7 +1503,7 @@ int saa7134_querycap(struct file *file, void *priv,unsigned int tuner_type = dev->tuner_type; -strcpy (cap->driver,"saa7134" ); +strscpy (cap->driver,"saa7134" ,sizeof (cap->driver));strscpy (cap->card, saa7134_boards[dev->board].name,sizeof (cap->card));sprintf (cap->bus_info,"PCI:%s" ,pci_name (dev->pci));
@@ -1747,7 +1748,7 @@ int saa7134_g_tuner(struct file *file, void *priv,if (n ==SAA7134_INPUT_MAX )return -EINVAL ;if (card_in (dev, n).type !=SAA7134_NO_INPUT ) { -strcpy (t->name,"Television" ); +strscpy (t->name,"Television" ,sizeof (t->name)); t->type =V4L2_TUNER_ANALOG_TV ;saa_call_all (dev, tuner, g_tuner, t); t->capability = V4L2_TUNER_CAP_NORM |
@@ -1939,7 +1940,7 @@ static int radio_g_tuner(struct file *file, void *priv,if (0 != t->index)return -EINVAL ; -strcpy (t->name,"Radio" ); +strscpy (t->name,"Radio" ,sizeof (t->name));saa_call_all (dev, tuner, g_tuner, t); t->audmode &=V4L2_TUNER_MODE_MONO |V4L2_TUNER_MODE_STEREO ;
drivers/media/pci/saa7164/saa7164-core.c +1 -1
@@ -179,7 +179,7 @@ static void saa7164_histogram_reset(struct saa7164_histogram *hg, char *name)int i;memset (hg,0 ,sizeof (struct saa7164_histogram )); -strcpy (hg->name, name); +strscpy (hg->name, name,sizeof (hg->name));/* First 30ms x 1ms */ for (i =0 ; i <30 ; i++)
drivers/media/pci/saa7164/saa7164-encoder.c +3 -3
@@ -258,7 +258,7 @@ int saa7164_enum_input(struct file *file, void *priv, struct v4l2_input *i)if (i->index >=7 )return -EINVAL ; -strcpy (i->name, inputs[i->index]); +strscpy (i->name, inputs[i->index],sizeof (i->name));if (i->index ==0 ) i->type =V4L2_INPUT_TYPE_TUNER ;
@@ -325,7 +325,7 @@ int saa7164_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->capability =V4L2_TUNER_CAP_NORM |V4L2_TUNER_CAP_STEREO ; t->rangelow =SAA7164_TV_MIN_FREQ ; t->rangehigh =SAA7164_TV_MAX_FREQ ;
@@ -497,7 +497,7 @@ static int vidioc_querycap(struct file *file, void *priv,struct saa7164_port *port = fh->port;struct saa7164_dev *dev = port->dev; -strcpy (cap->driver, dev->name); +strscpy (cap->driver, dev->name,sizeof (cap->driver));strscpy (cap->card, saa7164_boards[dev->board].name,sizeof (cap->card));sprintf (cap->bus_info,"PCI:%s" ,pci_name (dev->pci));
drivers/media/pci/saa7164/saa7164-vbi.c +1 -1
@@ -208,7 +208,7 @@ static int vidioc_querycap(struct file *file, void *priv,struct saa7164_port *port = fh->port;struct saa7164_dev *dev = port->dev; -strcpy (cap->driver, dev->name); +strscpy (cap->driver, dev->name,sizeof (cap->driver));strscpy (cap->card, saa7164_boards[dev->board].name,sizeof (cap->card));sprintf (cap->bus_info,"PCI:%s" ,pci_name (dev->pci));
drivers/media/pci/smipcie/smipcie-main.c +2 -2
@@ -191,7 +191,7 @@ static int smi_i2c_init(struct smi_dev *dev)/* i2c bus 0 */ smi_i2c_cfg (dev,I2C_A_SW_CTL );i2c_set_adapdata (&dev->i2c_bus[0 ], dev); -strcpy (dev->i2c_bus[0 ].name,"SMI-I2C0" ); +strscpy (dev->i2c_bus[0 ].name,"SMI-I2C0" ,sizeof (dev->i2c_bus[0 ].name)); dev->i2c_bus[0 ].owner =THIS_MODULE ; dev->i2c_bus[0 ].dev.parent = &dev->pci_dev->dev; dev->i2c_bus[0 ].algo_data = &dev->i2c_bit[0 ];
@@ -213,7 +213,7 @@ static int smi_i2c_init(struct smi_dev *dev)/* i2c bus 1 */ smi_i2c_cfg (dev,I2C_B_SW_CTL );i2c_set_adapdata (&dev->i2c_bus[1 ], dev); -strcpy (dev->i2c_bus[1 ].name,"SMI-I2C1" ); +strscpy (dev->i2c_bus[1 ].name,"SMI-I2C1" ,sizeof (dev->i2c_bus[1 ].name)); dev->i2c_bus[1 ].owner =THIS_MODULE ; dev->i2c_bus[1 ].dev.parent = &dev->pci_dev->dev; dev->i2c_bus[1 ].algo_data = &dev->i2c_bit[1 ];
drivers/media/pci/solo6x10/solo6x10-g723.c +4 -4
@@ -354,7 +354,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)snd_pcm_chip (pcm) = solo_dev; pcm->info_flags =0 ; -strcpy (pcm->name, card->shortname); +strscpy (pcm->name, card->shortname,sizeof (pcm->name));for (i =0 , ss = pcm->streams[SNDRV_PCM_STREAM_CAPTURE ].substream; ss; ss = ss->next, i++)
@@ -394,8 +394,8 @@ int solo_g723_init(struct solo_dev *solo_dev) card = solo_dev->snd_card; -strcpy (card->driver,SOLO6X10_NAME ); -strcpy (card->shortname,"SOLO-6x10 Audio" ); +strscpy (card->driver,SOLO6X10_NAME ,sizeof (card->driver)); +strscpy (card->shortname,"SOLO-6x10 Audio" ,sizeof (card->shortname));sprintf (card->longname,"%s on %s IRQ %d" , card->shortname,pci_name (solo_dev->pdev), solo_dev->pdev->irq);
@@ -404,7 +404,7 @@ int solo_g723_init(struct solo_dev *solo_dev) goto snd_error;/* Mixer controls */ -strcpy (card->mixername,"SOLO-6x10" ); +strscpy (card->mixername,"SOLO-6x10" ,sizeof (card->mixername)); kctl = snd_solo_capture_volume; kctl.count = solo_dev->nr_chans;
drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c +8 -5
@@ -775,7 +775,7 @@ static int solo_enc_querycap(struct file *file, void *priv,struct solo_enc_dev *solo_enc =video_drvdata (file);struct solo_dev *solo_dev = solo_enc->solo_dev; -strcpy (cap->driver,SOLO6X10_NAME ); +strscpy (cap->driver,SOLO6X10_NAME ,sizeof (cap->driver));snprintf (cap->card,sizeof (cap->card),"Softlogic 6x10 Enc %d" , solo_enc->ch); snprintf(cap->bus_info, sizeof(cap->bus_info), "PCI:%s",
@@ -834,17 +834,19 @@ static int solo_enc_enum_fmt_cap(struct file *file, void *priv,switch (dev_type) {case SOLO_DEV_6010 : f->pixelformat =V4L2_PIX_FMT_MPEG4 ; -strcpy (f->description,"MPEG-4 part 2" ); +strscpy (f->description,"MPEG-4 part 2" , +sizeof (f->description));break ;case SOLO_DEV_6110 : f->pixelformat =V4L2_PIX_FMT_H264 ; -strcpy (f->description,"H.264" ); +strscpy (f->description,"H.264" , +sizeof (f->description));break ; }break ;case 1 : f->pixelformat =V4L2_PIX_FMT_MJPEG ; -strcpy (f->description,"MJPEG" ); +strscpy (f->description,"MJPEG" ,sizeof (f->description));break ;default :return -EINVAL ;
@@ -1126,7 +1128,8 @@ static int solo_s_ctrl(struct v4l2_ctrl *ctrl) solo_enc->md_thresholds->p_new.p_u16);break ;case V4L2_CID_OSD_TEXT : -strcpy (solo_enc->osd_text, ctrl->p_new.p_char); +strscpy (solo_enc->osd_text, ctrl->p_new.p_char, +sizeof (solo_enc->osd_text));return solo_osd_print (solo_enc);default :return -EINVAL ;
drivers/media/pci/solo6x10/solo6x10-v4l2.c +2 -2
@@ -383,8 +383,8 @@ static int solo_querycap(struct file *file, void *priv, {struct solo_dev *solo_dev =video_drvdata (file); -strcpy (cap->driver,SOLO6X10_NAME ); -strcpy (cap->card,"Softlogic 6x10" ); +strscpy (cap->driver,SOLO6X10_NAME ,sizeof (cap->driver)); +strscpy (cap->card,"Softlogic 6x10" ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"PCI:%s" ,pci_name (solo_dev->pdev)); cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
drivers/media/pci/sta2x11/sta2x11_vip.c +3 -3
@@ -419,8 +419,8 @@ static int vidioc_querycap(struct file *file, void *priv, {struct sta2x11_vip *vip =video_drvdata (file); -strcpy (cap->driver,KBUILD_MODNAME ); -strcpy (cap->card,KBUILD_MODNAME ); +strscpy (cap->driver,KBUILD_MODNAME ,sizeof (cap->driver)); +strscpy (cap->card,KBUILD_MODNAME ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"PCI:%s" ,pci_name (vip->pdev)); cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
@@ -580,7 +580,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,if (f->index !=0 )return -EINVAL ; -strcpy (f->description,"4:2:2, packed, UYVY" ); +strscpy (f->description,"4:2:2, packed, UYVY" ,sizeof (f->description)); f->pixelformat =V4L2_PIX_FMT_UYVY ; f->flags =0 ;return 0 ;
drivers/media/pci/ttpci/av7110_v4l.c +1 -1
@@ -332,7 +332,7 @@ static int vidioc_g_tuner(struct file *file, void *fh, struct v4l2_tuner *t)return -EINVAL ;memset (t,0 ,sizeof (*t)); -strcpy ((char *)t->name,"Television" ); +strscpy ((char *)t->name,"Television" ,sizeof (t->name)); t->type =V4L2_TUNER_ANALOG_TV ; t->capability = V4L2_TUNER_CAP_NORM | V4L2_TUNER_CAP_STEREO |
drivers/media/pci/ttpci/budget-core.c +2 -1
@@ -508,7 +508,8 @@ int ttpci_budget_init(struct budget *budget, struct saa7146_dev *dev, sizeof(budget->i2c_adap.name));saa7146_i2c_adapter_prepare (dev, &budget->i2c_adap,SAA7146_I2C_BUS_BIT_RATE_120 ); -strcpy (budget->i2c_adap.name, budget->card->name); +strscpy (budget->i2c_adap.name, budget->card->name, +sizeof (budget->i2c_adap.name));if (i2c_add_adapter (&budget->i2c_adap) <0 ) { ret = -ENOMEM ;
drivers/media/pci/tw5864/tw5864-video.c +1 -1
@@ -610,7 +610,7 @@ static int tw5864_querycap(struct file *file, void *priv, {struct tw5864_input *input =video_drvdata (file); -strcpy (cap->driver,"tw5864" ); +strscpy (cap->driver,"tw5864" ,sizeof (cap->driver));snprintf (cap->card,sizeof (cap->card),"TW5864 Encoder %d" , input->nr);sprintf (cap->bus_info,"PCI:%s" ,pci_name (input->root->pci));
drivers/media/pci/tw68/tw68-video.c +1 -1
@@ -734,7 +734,7 @@ static int tw68_querycap(struct file *file, void *priv, {struct tw68_dev *dev =video_drvdata (file); -strcpy (cap->driver,"tw68" ); +strscpy (cap->driver,"tw68" ,sizeof (cap->driver));strscpy (cap->card,"Techwell Capture Card" ,sizeof (cap->card));sprintf (cap->bus_info,"PCI:%s" ,pci_name (dev->pci));
drivers/media/platform/am437x/am437x-vpfe.c +2 -1
@@ -2455,7 +2455,8 @@ vpfe_get_pdata(struct platform_device *pdev)/* we only support camera */ sdinfo->inputs[0 ].index = i; -strcpy (sdinfo->inputs[0 ].name,"Camera" ); +strscpy (sdinfo->inputs[0 ].name,"Camera" , +sizeof (sdinfo->inputs[0 ].name)); sdinfo->inputs[0 ].type =V4L2_INPUT_TYPE_CAMERA ; sdinfo->inputs[0 ].std =V4L2_STD_ALL ; sdinfo->inputs[0 ].capabilities =V4L2_IN_CAP_STD ;
drivers/media/platform/atmel/atmel-isc.c +3 -3
@@ -1238,8 +1238,8 @@ static int isc_querycap(struct file *file, void *priv, {struct isc_device *isc =video_drvdata (file); -strcpy (cap->driver,ATMEL_ISC_NAME ); -strcpy (cap->card,"Atmel Image Sensor Controller" ); +strscpy (cap->driver,ATMEL_ISC_NAME ,sizeof (cap->driver)); +strscpy (cap->card,"Atmel Image Sensor Controller" ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" , isc->v4l2_dev.name);
@@ -1393,7 +1393,7 @@ static int isc_enum_input(struct file *file, void *priv, inp->type =V4L2_INPUT_TYPE_CAMERA ; inp->std =0 ; -strcpy (inp->name,"Camera" ); +strscpy (inp->name,"Camera" ,sizeof (inp->name));return 0 ; }
drivers/media/platform/davinci/vpbe_display.c +4 -2
@@ -816,10 +816,12 @@ static int vpbe_display_enum_fmt(struct file *file, void *priv, fmt->index = index; fmt->type =V4L2_BUF_TYPE_VIDEO_OUTPUT ;if (index ==0 ) { -strcpy (fmt->description,"YUV 4:2:2 - UYVY" ); +strscpy (fmt->description,"YUV 4:2:2 - UYVY" , +sizeof (fmt->description)); fmt->pixelformat =V4L2_PIX_FMT_UYVY ; }else { -strcpy (fmt->description,"Y/CbCr 4:2:0" ); +strscpy (fmt->description,"Y/CbCr 4:2:0" , +sizeof (fmt->description)); fmt->pixelformat =V4L2_PIX_FMT_NV12 ; }
drivers/media/platform/davinci/vpbe_venc.c +1 -1
@@ -616,7 +616,7 @@ struct v4l2_subdev *venc_sub_dev_init(struct v4l2_device *v4l2_dev,v4l2_subdev_init (&venc->sd, &venc_ops); -strcpy (venc->sd.name, venc_name); +strscpy (venc->sd.name, venc_name,sizeof (venc->sd.name));if (v4l2_device_register_subdev (v4l2_dev, &venc->sd) <0 ) {v4l2_err (v4l2_dev,"vpbe unable to register venc sub device\n" );
drivers/media/platform/davinci/vpif_capture.c +4 -2
@@ -949,11 +949,13 @@ static int vpif_enum_fmt_vid_cap(struct file *file, void *priv,/* Fill in the information about format */ if (ch->vpifparams.iface.if_type ==VPIF_IF_RAW_BAYER ) { fmt->type =V4L2_BUF_TYPE_VIDEO_CAPTURE ; -strcpy (fmt->description,"Raw Mode -Bayer Pattern GrRBGb" ); +strscpy (fmt->description,"Raw Mode -Bayer Pattern GrRBGb" , +sizeof (fmt->description)); fmt->pixelformat =V4L2_PIX_FMT_SBGGR8 ; }else { fmt->type =V4L2_BUF_TYPE_VIDEO_CAPTURE ; -strcpy (fmt->description,"YCbCr4:2:2 Semi-Planar" ); +strscpy (fmt->description,"YCbCr4:2:2 Semi-Planar" , +sizeof (fmt->description)); fmt->pixelformat =V4L2_PIX_FMT_NV16 ; }return 0 ;
drivers/media/platform/davinci/vpif_display.c +2 -1
@@ -602,7 +602,8 @@ static int vpif_enum_fmt_vid_out(struct file *file, void *priv,/* Fill in the information about format */ fmt->type =V4L2_BUF_TYPE_VIDEO_OUTPUT ; -strcpy (fmt->description,"YCbCr4:2:2 YC Planar" ); +strscpy (fmt->description,"YCbCr4:2:2 YC Planar" , +sizeof (fmt->description)); fmt->pixelformat =V4L2_PIX_FMT_YUV422P ; fmt->flags =0 ;return 0 ;
drivers/media/platform/fsl-viu.c +4 -4
@@ -565,9 +565,9 @@ static const struct videobuf_queue_ops viu_video_qops = {static int vidioc_querycap (struct file *file,void *priv,struct v4l2_capability *cap) { -strcpy (cap->driver,"viu" ); -strcpy (cap->card,"viu" ); -strcpy (cap->bus_info,"platform:viu" ); +strscpy (cap->driver,"viu" ,sizeof (cap->driver)); +strscpy (cap->card,"viu" ,sizeof (cap->card)); +strscpy (cap->bus_info,"platform:viu" ,sizeof (cap->bus_info)); cap->device_caps =V4L2_CAP_VIDEO_CAPTURE |V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_OVERLAY |
@@ -941,7 +941,7 @@ static int vidioc_enum_input(struct file *file, void *priv, inp->type =V4L2_INPUT_TYPE_CAMERA ; inp->std = fh->dev->vdev->tvnorms; -strcpy (inp->name,"Camera" ); +strscpy (inp->name,"Camera" ,sizeof (inp->name));return 0 ; }
drivers/media/platform/marvell-ccic/cafe-driver.c +1 -1
@@ -341,7 +341,7 @@ static int cafe_smbus_setup(struct cafe_camera *cam)return -ENOMEM ; adap->owner =THIS_MODULE ; adap->algo = &cafe_smbus_algo; -strcpy (adap->name,"cafe_ccic" ); +strscpy (adap->name,"cafe_ccic" ,sizeof (adap->name)); adap->dev.parent = &cam->pdev->dev;i2c_set_adapdata (adap, cam); ret =i2c_add_adapter (adap);
drivers/media/platform/marvell-ccic/mcam-core.c +3 -3
@@ -1303,8 +1303,8 @@ static int mcam_vidioc_querycap(struct file *file, void *priv, {struct mcam_camera *cam =video_drvdata (file); -strcpy (cap->driver,"marvell_ccic" ); -strcpy (cap->card,"marvell_ccic" ); +strscpy (cap->driver,"marvell_ccic" ,sizeof (cap->driver)); +strscpy (cap->card,"marvell_ccic" ,sizeof (cap->card));strscpy (cap->bus_info, cam->bus_info,sizeof (cap->bus_info)); cap->device_caps =V4L2_CAP_VIDEO_CAPTURE |V4L2_CAP_READWRITE |V4L2_CAP_STREAMING ;
@@ -1421,7 +1421,7 @@ static int mcam_vidioc_enum_input(struct file *filp, void *priv,return -EINVAL ; input->type =V4L2_INPUT_TYPE_CAMERA ; -strcpy (input->name,"Camera" ); +strscpy (input->name,"Camera" ,sizeof (input->name));return 0 ; }
drivers/media/platform/soc_camera/soc_camera.c +1 -1
@@ -312,7 +312,7 @@ static int soc_camera_enum_input(struct file *file, void *priv,/* default is camera */ inp->type =V4L2_INPUT_TYPE_CAMERA ; inp->std = icd->vdev->tvnorms; -strcpy (inp->name,"Camera" ); +strscpy (inp->name,"Camera" ,sizeof (inp->name));return 0 ; }
drivers/media/platform/via-camera.c +3 -3
@@ -812,7 +812,7 @@ static int viacam_enum_input(struct file *filp, void *priv, input->type =V4L2_INPUT_TYPE_CAMERA ; input->std =V4L2_STD_ALL ;/* Not sure what should go here */ -strcpy (input->name,"Camera" ); +strscpy (input->name,"Camera" ,sizeof (input->name));return 0 ; }
@@ -990,8 +990,8 @@ static int viacam_s_fmt_vid_cap(struct file *filp, void *priv,static int viacam_querycap (struct file *filp,void *priv,struct v4l2_capability *cap) { -strcpy (cap->driver,"via-camera" ); -strcpy (cap->card,"via-camera" ); +strscpy (cap->driver,"via-camera" ,sizeof (cap->driver)); +strscpy (cap->card,"via-camera" ,sizeof (cap->card)); cap->device_caps =V4L2_CAP_VIDEO_CAPTURE |V4L2_CAP_READWRITE |V4L2_CAP_STREAMING ; cap->capabilities = cap->device_caps |V4L2_CAP_DEVICE_CAPS ;
drivers/media/platform/vivid/vivid-cec.c +2 -2
@@ -241,11 +241,11 @@ static int vivid_received(struct cec_adapter *adap, struct cec_msg *msg)cec_ops_set_osd_string (msg, &disp_ctl, osd);switch (disp_ctl) {case CEC_OP_DISP_CTL_DEFAULT : -strcpy (dev->osd, osd); +strscpy (dev->osd, osd,sizeof (dev->osd)); dev->osd_jiffies = jiffies;break ;case CEC_OP_DISP_CTL_UNTIL_CLEARED : -strcpy (dev->osd, osd); +strscpy (dev->osd, osd,sizeof (dev->osd)); dev->osd_jiffies =0 ;break ;case CEC_OP_DISP_CTL_CLEAR :
drivers/media/platform/vivid/vivid-core.c +2 -2
@@ -197,8 +197,8 @@ static int vidioc_querycap(struct file *file, void *priv, {struct vivid_dev *dev =video_drvdata (file); -strcpy (cap->driver,"vivid" ); -strcpy (cap->card,"vivid" ); +strscpy (cap->driver,"vivid" ,sizeof (cap->driver)); +strscpy (cap->card,"vivid" ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" , dev->v4l2_dev.name);
drivers/media/radio/dsbr100.c +1 -1
@@ -191,7 +191,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,return -EINVAL ;dsbr100_getstat (radio); -strcpy (v->name,"FM" ); +strscpy (v->name,"FM" ,sizeof (v->name)); v->type =V4L2_TUNER_RADIO ; v->rangelow =FREQ_MIN *FREQ_MUL ; v->rangehigh =FREQ_MAX *FREQ_MUL ;
drivers/media/radio/radio-ma901.c +1 -1
@@ -222,7 +222,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,* retval = ma901radio_get_stat(radio, &is_stereo, &v->signal); */ -strcpy (v->name,"FM" ); +strscpy (v->name,"FM" ,sizeof (v->name)); v->type =V4L2_TUNER_RADIO ; v->rangelow =FREQ_MIN *FREQ_MUL ; v->rangehigh =FREQ_MAX *FREQ_MUL ;
drivers/media/radio/radio-mr800.c +1 -1
@@ -291,7 +291,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,if (retval)return retval; -strcpy (v->name,"FM" ); +strscpy (v->name,"FM" ,sizeof (v->name)); v->type =V4L2_TUNER_RADIO ; v->rangelow =FREQ_MIN *FREQ_MUL ; v->rangehigh =FREQ_MAX *FREQ_MUL ;
drivers/media/radio/si470x/radio-si470x-common.c +1 -1
@@ -622,7 +622,7 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv, }/* driver constants */ -strcpy (tuner->name,"FM" ); +strscpy (tuner->name,"FM" ,sizeof (tuner->name)); tuner->type =V4L2_TUNER_RADIO ; tuner->capability =V4L2_TUNER_CAP_LOW |V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_RDS | V4L2_TUNER_CAP_RDS_BLOCK_IO |
drivers/media/radio/wl128x/fmdrv_v4l2.c +2 -2
@@ -249,7 +249,7 @@ static int fm_v4l2_vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *audio) {memset (audio,0 ,sizeof (*audio)); -strcpy (audio->name,"Radio" ); +strscpy (audio->name,"Radio" ,sizeof (audio->name)); audio->capability =V4L2_AUDCAP_STEREO ;return 0 ;
@@ -293,7 +293,7 @@ static int fm_v4l2_vidioc_g_tuner(struct file *file, void *priv,if (ret !=0 )return ret; -strcpy (tuner->name,"FM" ); +strscpy (tuner->name,"FM" ,sizeof (tuner->name)); tuner->type =V4L2_TUNER_RADIO ;/* Store rangelow and rangehigh freq in unit of 62.5 Hz */ tuner->rangelow = bottom_freq *16 ;
drivers/media/rc/imon.c +2 -2
@@ -772,9 +772,9 @@ static ssize_t show_associate_remote(struct device *d,mutex_lock (&ictx->lock);if (ictx->rf_isassociating) -strcpy (buf,"associating\n" ); +strscpy (buf,"associating\n" ,sizeof (buf));else -strcpy (buf,"closed\n" ); +strscpy (buf,"closed\n" ,sizeof (buf));dev_info (d,"Visit http://www.lirc.org/html/imon-24g.html for instructions on how to associate your iMON 2.4G DT/LT remote\n" );mutex_unlock (&ictx->lock);
drivers/media/usb/au0828/au0828-video.c +9 -9
@@ -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);
drivers/media/usb/cpia2/cpia2_v4l.c +6 -6
@@ -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 :
drivers/media/usb/cx231xx/cx231xx-audio.c +5 -4
@@ -679,10 +679,11 @@ 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);
drivers/media/usb/cx231xx/cx231xx-video.c +5 -4
@@ -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" );
drivers/media/usb/em28xx/em28xx-audio.c +4 -4
@@ -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);
drivers/media/usb/em28xx/em28xx-i2c.c +2 -1
@@ -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;
drivers/media/usb/em28xx/em28xx-video.c +11 -11
@@ -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);
drivers/media/usb/hdpvr/hdpvr-video.c +4 -3
@@ -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);
drivers/media/usb/pulse8-cec/pulse8-cec.c +2 -1
@@ -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 );
drivers/media/usb/pwc/pwc-if.c +1 -1
@@ -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);
drivers/media/usb/pwc/pwc-v4l.c +1 -1
@@ -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 |
drivers/media/usb/rainshadow-cec/rainshadow-cec.c +2 -1
@@ -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 ;
drivers/media/usb/stk1160/stk1160-i2c.c +1 -1
@@ -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);
drivers/media/usb/stk1160/stk1160-v4l.c +2 -2
@@ -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 |
drivers/media/usb/stkwebcam/stk-webcam.c +13 -8
@@ -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,28 @@ 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 ;
drivers/media/usb/tm6000/tm6000-alsa.c +3 -3
@@ -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);
drivers/media/usb/tm6000/tm6000-video.c +3 -3
@@ -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 ;
drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c +2 -1
@@ -1686,7 +1686,8 @@ 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);
drivers/media/usb/usbvision/usbvision-video.c +15 -10
@@ -504,9 +504,10 @@ 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 +516,25 @@ 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 +593,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 +818,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 ; }
drivers/media/usb/uvc/uvc_driver.c +1 -1
@@ -2138,7 +2138,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);
drivers/media/usb/zr364xx/zr364xx.c +2 -2
@@ -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 ; }
drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c +2 -1
@@ -639,7 +639,8 @@ static int vpfe_probe(struct platform_device *pdev) goto probe_disable_clock; vpfe_dev->media_dev.dev = vpfe_dev->pdev; -strcpy ((char *)&vpfe_dev->media_dev.model,"davinci-media" ); +strscpy ((char *)&vpfe_dev->media_dev.model,"davinci-media" , +sizeof (vpfe_dev->media_dev.model)); ret =media_device_register (&vpfe_dev->media_dev);if (ret) {
drivers/staging/media/imx/imx6-mipi-csi2.c +1 -1
@@ -597,7 +597,7 @@ static int csi2_probe(struct platform_device *pdev) csi2->sd.dev = &pdev->dev; csi2->sd.owner =THIS_MODULE ; csi2->sd.flags =V4L2_SUBDEV_FL_HAS_DEVNODE ; -strcpy (csi2->sd.name,DEVICE_NAME ); +strscpy (csi2->sd.name,DEVICE_NAME ,sizeof (csi2->sd.name)); csi2->sd.entity.function =MEDIA_ENT_F_VID_IF_BRIDGE ; csi2->sd.grp_id =IMX_MEDIA_GRP_ID_CSI2 ;
drivers/staging/media/zoran/zoran_card.c +2 -1
@@ -1048,7 +1048,8 @@ static int zr36057_init (struct zoran *zr) *zr->video_dev = zoran_template; zr->video_dev->v4l2_dev = &zr->v4l2_dev; zr->video_dev->lock = &zr->lock; -strcpy (zr->video_dev->name,ZR_DEVNAME (zr)); +strscpy (zr->video_dev->name,ZR_DEVNAME (zr), +sizeof (zr->video_dev->name));/* It's not a mem2mem device, but you can both capture and output from one and the same device. This should really be split up into two device nodes, but that's a job for another day. */
Signature · 1 line
2.17.1
cover Use only strscpy() for string copy
There are hot discussions upstream about getting rid of strcpy(), strncpy() and strlcpy() in favor of the safer strscpy().
While there are exceptions where strscpy() may not be the best option (for example, when filling records with fixed size), we don't have those situations right now on media.
On all cases, all the core and drivers are doing are filling some var with a name. So, we can switch all such functions by strscpy().
Mauro Carvalho Chehab (3):
media: use strscpy() instead of strlcpy()
media: replace strcpy() by strscpy()
media: replace strncpy() by strscpy()
drivers/media/cec/cec-api.c | 4 +- drivers/media/cec/cec-core.c | 2 +- drivers/media/common/b2c2/flexcop-i2c.c | 12 ++--- drivers/media/common/cx2341x.c | 2 +- drivers/media/common/saa7146/saa7146_fops.c | 2 +- drivers/media/common/saa7146/saa7146_video.c | 8 +-- drivers/media/common/siano/smscoreapi.c | 4 +- drivers/media/common/siano/smsir.c | 2 +- drivers/media/dvb-core/dvb_frontend.c | 2 +- drivers/media/dvb-core/dvb_vb2.c | 2 +- drivers/media/dvb-core/dvbdev.c | 4 +- drivers/media/dvb-frontends/as102_fe.c | 2 +- drivers/media/dvb-frontends/cx24123.c | 2 +- drivers/media/dvb-frontends/cxd2820r_core.c | 2 +- drivers/media/dvb-frontends/dib7000p.c | 3 +- drivers/media/dvb-frontends/dib8000.c | 4 +- drivers/media/dvb-frontends/dib9000.c | 6 ++- drivers/media/dvb-frontends/dibx000_common.c | 2 +- drivers/media/dvb-frontends/dvb-pll.c | 2 +- drivers/media/dvb-frontends/lgdt330x.c | 2 +- drivers/media/dvb-frontends/m88ds3103.c | 4 +- drivers/media/dvb-frontends/mt312.c | 9 ++-- drivers/media/dvb-frontends/rtl2832_sdr.c | 10 ++-- drivers/media/dvb-frontends/s5h1420.c | 2 +- drivers/media/dvb-frontends/tc90522.c | 2 +- drivers/media/dvb-frontends/ts2020.c | 2 +- drivers/media/dvb-frontends/zd1301_demod.c | 3 +- drivers/media/dvb-frontends/zl10039.c | 5 +- drivers/media/firewire/firedtv-fe.c | 2 +- drivers/media/i2c/ad5820.c | 2 +- drivers/media/i2c/cs53l32a.c | 2 +- drivers/media/i2c/imx274.c | 2 +- drivers/media/i2c/lm3560.c | 3 +- drivers/media/i2c/lm3646.c | 3 +- drivers/media/i2c/m5mols/m5mols_core.c | 2 +- drivers/media/i2c/max2175.c | 2 +- drivers/media/i2c/msp3400-driver.c | 2 +- drivers/media/i2c/noon010pc30.c | 2 +- drivers/media/i2c/ov9650.c | 2 +- drivers/media/i2c/s5c73m3/s5c73m3-core.c | 4 +- drivers/media/i2c/s5k4ecgx.c | 2 +- drivers/media/i2c/s5k6aa.c | 2 +- drivers/media/i2c/saa7115.c | 6 +-- drivers/media/i2c/saa7127.c | 4 +- drivers/media/i2c/sr030pc30.c | 2 +- drivers/media/i2c/tvaudio.c | 2 +- drivers/media/i2c/video-i2c.c | 8 +-- drivers/media/media-device.c | 28 +++++----- drivers/media/pci/bt8xx/bttv-driver.c | 10 ++-- drivers/media/pci/bt8xx/bttv-i2c.c | 6 +-- drivers/media/pci/bt8xx/bttv-input.c | 2 +- drivers/media/pci/bt8xx/dst.c | 3 +- drivers/media/pci/bt8xx/dvb-bt8xx.c | 3 +- drivers/media/pci/cobalt/cobalt-alsa-main.c | 2 +- drivers/media/pci/cobalt/cobalt-alsa-pcm.c | 4 +- drivers/media/pci/cobalt/cobalt-v4l2.c | 14 ++--- drivers/media/pci/cx18/cx18-alsa-main.c | 2 +- drivers/media/pci/cx18/cx18-alsa-pcm.c | 2 +- drivers/media/pci/cx18/cx18-cards.c | 8 +-- drivers/media/pci/cx18/cx18-driver.c | 2 +- drivers/media/pci/cx18/cx18-i2c.c | 2 +- drivers/media/pci/cx18/cx18-ioctl.c | 8 +-- drivers/media/pci/cx23885/cx23885-417.c | 8 +-- drivers/media/pci/cx23885/cx23885-alsa.c | 4 +- drivers/media/pci/cx23885/cx23885-dvb.c | 54 +++++++++---------- drivers/media/pci/cx23885/cx23885-i2c.c | 4 +- drivers/media/pci/cx23885/cx23885-ioctl.c | 4 +- drivers/media/pci/cx23885/cx23885-video.c | 15 +++--- drivers/media/pci/cx25821/cx25821-alsa.c | 8 +-- drivers/media/pci/cx25821/cx25821-i2c.c | 2 +- drivers/media/pci/cx25821/cx25821-video.c | 10 ++-- drivers/media/pci/cx88/cx88-alsa.c | 6 +-- drivers/media/pci/cx88/cx88-blackbird.c | 6 +-- drivers/media/pci/cx88/cx88-cards.c | 2 +- drivers/media/pci/cx88/cx88-i2c.c | 4 +- drivers/media/pci/cx88/cx88-input.c | 4 +- drivers/media/pci/cx88/cx88-video.c | 12 ++--- drivers/media/pci/cx88/cx88-vp3054-i2c.c | 2 +- drivers/media/pci/dm1105/dm1105.c | 5 +- drivers/media/pci/dt3155/dt3155.c | 8 +-- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 8 +-- drivers/media/pci/ivtv/ivtv-alsa-main.c | 2 +- drivers/media/pci/ivtv/ivtv-alsa-pcm.c | 2 +- drivers/media/pci/ivtv/ivtv-cards.c | 12 ++--- drivers/media/pci/ivtv/ivtv-i2c.c | 4 +- drivers/media/pci/ivtv/ivtv-ioctl.c | 8 +-- drivers/media/pci/ivtv/ivtvfb.c | 2 +- drivers/media/pci/mantis/mantis_i2c.c | 2 +- drivers/media/pci/meye/meye.c | 10 ++-- drivers/media/pci/ngene/ngene-i2c.c | 2 +- drivers/media/pci/pluto2/pluto2.c | 3 +- drivers/media/pci/pt1/pt1.c | 2 +- drivers/media/pci/pt3/pt3.c | 2 +- drivers/media/pci/saa7134/saa7134-alsa.c | 8 +-- drivers/media/pci/saa7134/saa7134-empress.c | 2 +- drivers/media/pci/saa7134/saa7134-go7007.c | 4 +- drivers/media/pci/saa7134/saa7134-i2c.c | 2 +- drivers/media/pci/saa7134/saa7134-input.c | 2 +- drivers/media/pci/saa7134/saa7134-video.c | 15 +++--- drivers/media/pci/saa7146/mxb.c | 2 +- drivers/media/pci/saa7164/saa7164-core.c | 2 +- drivers/media/pci/saa7164/saa7164-dvb.c | 10 ++-- drivers/media/pci/saa7164/saa7164-encoder.c | 10 ++-- drivers/media/pci/saa7164/saa7164-i2c.c | 2 +- drivers/media/pci/saa7164/saa7164-vbi.c | 4 +- drivers/media/pci/smipcie/smipcie-main.c | 12 ++--- drivers/media/pci/solo6x10/solo6x10-g723.c | 8 +-- .../media/pci/solo6x10/solo6x10-v4l2-enc.c | 13 +++-- drivers/media/pci/solo6x10/solo6x10-v4l2.c | 6 +-- drivers/media/pci/sta2x11/sta2x11_vip.c | 6 +-- drivers/media/pci/ttpci/av7110.c | 3 +- drivers/media/pci/ttpci/av7110_v4l.c | 2 +- drivers/media/pci/ttpci/budget-core.c | 6 ++- drivers/media/pci/tw5864/tw5864-video.c | 2 +- drivers/media/pci/tw68/tw68-video.c | 6 +-- drivers/media/pci/tw686x/tw686x-audio.c | 8 +-- drivers/media/pci/tw686x/tw686x-video.c | 4 +- drivers/media/platform/am437x/am437x-vpfe.c | 11 ++-- drivers/media/platform/atmel/atmel-isc.c | 8 +-- drivers/media/platform/atmel/atmel-isi.c | 10 ++-- drivers/media/platform/coda/coda-common.c | 8 +-- drivers/media/platform/davinci/vpbe_display.c | 8 +-- drivers/media/platform/davinci/vpbe_venc.c | 2 +- drivers/media/platform/davinci/vpfe_capture.c | 8 +-- drivers/media/platform/davinci/vpif_capture.c | 14 ++--- drivers/media/platform/davinci/vpif_display.c | 12 ++--- drivers/media/platform/exynos-gsc/gsc-core.c | 2 +- drivers/media/platform/exynos-gsc/gsc-m2m.c | 4 +- drivers/media/platform/exynos4-is/common.c | 4 +- .../media/platform/exynos4-is/fimc-capture.c | 4 +- .../media/platform/exynos4-is/fimc-is-i2c.c | 2 +- .../platform/exynos4-is/fimc-isp-video.c | 2 +- drivers/media/platform/exynos4-is/fimc-lite.c | 6 +-- drivers/media/platform/exynos4-is/fimc-m2m.c | 2 +- drivers/media/platform/exynos4-is/media-dev.c | 8 +-- drivers/media/platform/fsl-viu.c | 8 +-- drivers/media/platform/m2m-deinterlace.c | 8 +-- .../media/platform/marvell-ccic/cafe-driver.c | 2 +- .../media/platform/marvell-ccic/mcam-core.c | 12 ++--- .../media/platform/marvell-ccic/mmp-driver.c | 2 +- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 4 +- drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c | 6 +-- .../platform/mtk-vcodec/mtk_vcodec_dec.c | 6 +-- .../platform/mtk-vcodec/mtk_vcodec_enc.c | 6 +-- drivers/media/platform/mtk-vpu/mtk_vpu.c | 2 +- drivers/media/platform/mx2_emmaprp.c | 6 +-- drivers/media/platform/omap/omap_vout.c | 10 ++-- drivers/media/platform/omap3isp/isp.c | 2 +- drivers/media/platform/omap3isp/ispccdc.c | 2 +- drivers/media/platform/omap3isp/ispccp2.c | 2 +- drivers/media/platform/omap3isp/ispcsi2.c | 2 +- drivers/media/platform/omap3isp/isppreview.c | 2 +- drivers/media/platform/omap3isp/ispresizer.c | 2 +- drivers/media/platform/omap3isp/ispvideo.c | 8 +-- drivers/media/platform/pxa_camera.c | 8 +-- .../media/platform/qcom/camss/camss-video.c | 8 +-- drivers/media/platform/qcom/camss/camss.c | 2 +- drivers/media/platform/qcom/venus/vdec.c | 8 +-- drivers/media/platform/qcom/venus/venc.c | 8 +-- drivers/media/platform/rcar-vin/rcar-core.c | 4 +- drivers/media/platform/rcar-vin/rcar-v4l2.c | 8 +-- drivers/media/platform/rcar_drif.c | 4 +- drivers/media/platform/rcar_fdp1.c | 6 +-- drivers/media/platform/rcar_jpu.c | 10 ++-- drivers/media/platform/renesas-ceu.c | 6 +-- drivers/media/platform/rockchip/rga/rga.c | 6 +-- .../media/platform/s3c-camif/camif-capture.c | 10 ++-- drivers/media/platform/s3c-camif/camif-core.c | 4 +- drivers/media/platform/s5p-g2d/g2d.c | 6 +-- drivers/media/platform/s5p-jpeg/jpeg-core.c | 10 ++-- drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 6 +-- drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 6 +-- drivers/media/platform/sh_veu.c | 9 ++-- drivers/media/platform/sh_vou.c | 10 ++-- .../soc_camera/sh_mobile_ceu_camera.c | 6 +-- .../media/platform/soc_camera/soc_camera.c | 8 +-- .../platform/soc_camera/soc_camera_platform.c | 2 +- drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 4 +- drivers/media/platform/sti/delta/delta-v4l2.c | 4 +- drivers/media/platform/sti/hva/hva-v4l2.c | 4 +- drivers/media/platform/stm32/stm32-dcmi.c | 10 ++-- drivers/media/platform/ti-vpe/cal.c | 6 +-- drivers/media/platform/ti-vpe/vpe.c | 6 +-- drivers/media/platform/via-camera.c | 10 ++-- drivers/media/platform/vicodec/vicodec-core.c | 10 ++-- drivers/media/platform/vim2m.c | 6 +-- drivers/media/platform/vimc/vimc-capture.c | 6 +-- drivers/media/platform/vimc/vimc-common.c | 2 +- drivers/media/platform/vimc/vimc-core.c | 4 +- drivers/media/platform/vivid/vivid-cec.c | 4 +- drivers/media/platform/vivid/vivid-core.c | 4 +- drivers/media/platform/vivid/vivid-osd.c | 2 +- .../media/platform/vivid/vivid-radio-common.c | 4 +- drivers/media/platform/vivid/vivid-radio-rx.c | 2 +- drivers/media/platform/vivid/vivid-radio-tx.c | 2 +- drivers/media/platform/vivid/vivid-rds-gen.c | 4 +- drivers/media/platform/vivid/vivid-sdr-cap.c | 4 +- drivers/media/platform/vivid/vivid-vid-cap.c | 2 +- drivers/media/platform/vsp1/vsp1_drv.c | 2 +- drivers/media/platform/vsp1/vsp1_histo.c | 4 +- drivers/media/platform/vsp1/vsp1_video.c | 4 +- drivers/media/platform/xilinx/xilinx-dma.c | 6 +-- drivers/media/platform/xilinx/xilinx-tpg.c | 2 +- drivers/media/platform/xilinx/xilinx-vipp.c | 2 +- drivers/media/radio/dsbr100.c | 9 ++-- drivers/media/radio/radio-cadet.c | 12 ++--- drivers/media/radio/radio-isa.c | 10 ++-- drivers/media/radio/radio-keene.c | 8 +-- drivers/media/radio/radio-ma901.c | 8 +-- drivers/media/radio/radio-maxiradio.c | 2 +- drivers/media/radio/radio-miropcm20.c | 10 ++-- drivers/media/radio/radio-mr800.c | 8 +-- drivers/media/radio/radio-raremono.c | 8 +-- drivers/media/radio/radio-sf16fmi.c | 12 ++--- drivers/media/radio/radio-sf16fmr2.c | 6 +-- drivers/media/radio/radio-shark.c | 2 +- drivers/media/radio/radio-shark2.c | 2 +- drivers/media/radio/radio-si476x.c | 12 ++--- drivers/media/radio/radio-tea5764.c | 6 +-- drivers/media/radio/radio-tea5777.c | 12 ++--- drivers/media/radio/radio-timb.c | 8 +-- drivers/media/radio/radio-wl1273.c | 12 ++--- .../media/radio/si470x/radio-si470x-common.c | 2 +- drivers/media/radio/si470x/radio-si470x-i2c.c | 4 +- drivers/media/radio/si470x/radio-si470x-usb.c | 4 +- .../radio/si4713/radio-platform-si4713.c | 6 +-- drivers/media/radio/si4713/radio-usb-si4713.c | 6 +-- drivers/media/radio/si4713/si4713.c | 2 +- drivers/media/radio/tea575x.c | 10 ++-- drivers/media/radio/tef6862.c | 2 +- drivers/media/radio/wl128x/fmdrv_v4l2.c | 13 ++--- drivers/media/rc/ati_remote.c | 2 +- drivers/media/rc/imon.c | 4 +- drivers/media/rc/mceusb.c | 2 +- drivers/media/rc/streamzap.c | 2 +- drivers/media/tuners/e4000.c | 2 +- drivers/media/tuners/fc2580.c | 2 +- drivers/media/tuners/msi001.c | 2 +- drivers/media/tuners/mt20xx.c | 2 +- drivers/media/tuners/tuner-simple.c | 2 +- drivers/media/usb/airspy/airspy.c | 10 ++-- drivers/media/usb/au0828/au0828-i2c.c | 2 +- drivers/media/usb/au0828/au0828-video.c | 22 ++++---- drivers/media/usb/cpia2/cpia2_v4l.c | 12 ++--- drivers/media/usb/cx231xx/cx231xx-417.c | 2 +- drivers/media/usb/cx231xx/cx231xx-audio.c | 9 ++-- drivers/media/usb/cx231xx/cx231xx-input.c | 2 +- drivers/media/usb/cx231xx/cx231xx-video.c | 27 +++++----- drivers/media/usb/dvb-usb-v2/af9035.c | 2 +- drivers/media/usb/dvb-usb-v2/anysee.c | 2 +- drivers/media/usb/dvb-usb-v2/dvb_usb_core.c | 2 +- drivers/media/usb/dvb-usb-v2/gl861.c | 2 +- drivers/media/usb/dvb-usb-v2/lmedm04.c | 2 +- drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 18 +++---- drivers/media/usb/dvb-usb-v2/zd1301.c | 2 +- drivers/media/usb/dvb-usb/cxusb.c | 4 +- drivers/media/usb/dvb-usb/dib0700_devices.c | 4 +- drivers/media/usb/dvb-usb/dvb-usb-i2c.c | 2 +- drivers/media/usb/dvb-usb/dw2102.c | 4 +- drivers/media/usb/dvb-usb/technisat-usb2.c | 5 +- drivers/media/usb/em28xx/em28xx-audio.c | 8 +-- drivers/media/usb/em28xx/em28xx-i2c.c | 3 +- drivers/media/usb/em28xx/em28xx-video.c | 32 +++++------ drivers/media/usb/go7007/go7007-driver.c | 2 +- drivers/media/usb/go7007/go7007-usb.c | 16 +++--- drivers/media/usb/go7007/go7007-v4l2.c | 18 +++---- drivers/media/usb/go7007/snd-go7007.c | 8 +-- drivers/media/usb/gspca/gspca.c | 10 ++-- drivers/media/usb/gspca/sn9c20x.c | 2 +- drivers/media/usb/hackrf/hackrf.c | 12 ++--- drivers/media/usb/hdpvr/hdpvr-video.c | 18 +++---- drivers/media/usb/msi2500/msi2500.c | 8 +-- drivers/media/usb/pulse8-cec/pulse8-cec.c | 7 +-- drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 2 +- drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c | 6 +-- drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 14 ++--- drivers/media/usb/pwc/pwc-if.c | 2 +- drivers/media/usb/pwc/pwc-v4l.c | 12 +++-- .../media/usb/rainshadow-cec/rainshadow-cec.c | 3 +- drivers/media/usb/s2255/s2255drv.c | 10 ++-- drivers/media/usb/stk1160/stk1160-i2c.c | 2 +- drivers/media/usb/stk1160/stk1160-v4l.c | 6 +-- drivers/media/usb/stkwebcam/stk-webcam.c | 21 +++++--- drivers/media/usb/tm6000/tm6000-alsa.c | 6 +-- drivers/media/usb/tm6000/tm6000-i2c.c | 4 +- drivers/media/usb/tm6000/tm6000-video.c | 13 ++--- .../media/usb/ttusb-budget/dvb-ttusb-budget.c | 3 +- drivers/media/usb/usbtv/usbtv-audio.c | 6 +-- drivers/media/usb/usbtv/usbtv-video.c | 14 ++--- drivers/media/usb/usbvision/usbvision-video.c | 29 +++++----- drivers/media/usb/uvc/uvc_ctrl.c | 4 +- drivers/media/usb/uvc/uvc_driver.c | 22 ++++---- drivers/media/usb/uvc/uvc_entity.c | 2 +- drivers/media/usb/uvc/uvc_metadata.c | 4 +- drivers/media/usb/uvc/uvc_v4l2.c | 10 ++-- drivers/media/usb/zr364xx/zr364xx.c | 10 ++-- drivers/media/v4l2-core/v4l2-common.c | 6 +-- drivers/media/v4l2-core/v4l2-ctrls.c | 8 +-- drivers/media/v4l2-core/v4l2-device.c | 2 +- .../media/v4l2-core/v4l2-flash-led-class.c | 2 +- drivers/media/v4l2-core/v4l2-ioctl.c | 8 +-- drivers/media/v4l2-core/v4l2-subdev.c | 2 +- drivers/staging/media/bcm2048/radio-bcm2048.c | 8 +-- .../staging/media/davinci_vpfe/dm365_ipipe.c | 2 +- .../media/davinci_vpfe/dm365_ipipeif.c | 2 +- .../staging/media/davinci_vpfe/dm365_isif.c | 2 +- .../media/davinci_vpfe/dm365_resizer.c | 6 +-- .../media/davinci_vpfe/vpfe_mc_capture.c | 3 +- .../staging/media/davinci_vpfe/vpfe_video.c | 6 +-- drivers/staging/media/imx/imx-ic-common.c | 2 +- drivers/staging/media/imx/imx-media-capture.c | 4 +- drivers/staging/media/imx/imx-media-dev.c | 4 +- drivers/staging/media/imx/imx-media-vdic.c | 2 +- drivers/staging/media/imx/imx6-mipi-csi2.c | 2 +- drivers/staging/media/omap4iss/iss.c | 2 +- drivers/staging/media/omap4iss/iss_ipipe.c | 2 +- drivers/staging/media/omap4iss/iss_ipipeif.c | 2 +- drivers/staging/media/omap4iss/iss_resizer.c | 2 +- drivers/staging/media/omap4iss/iss_video.c | 10 ++-- drivers/staging/media/zoran/zoran_card.c | 7 +-- drivers/staging/media/zoran/zoran_driver.c | 14 ++--- 321 files changed, 977 insertions(+), 927 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/3 media: use strscpy() instead of strlcpy()
The implementation of strscpy() is more robust and safer.
That's now the recommended way to copy NUL terminated strings.
--- drivers/media/cec/cec-api.c | 4 +- drivers/media/cec/cec-core.c | 2 +- drivers/media/common/b2c2/flexcop-i2c.c | 12 ++--- drivers/media/common/cx2341x.c | 2 +- drivers/media/common/saa7146/saa7146_fops.c | 2 +- drivers/media/common/saa7146/saa7146_video.c | 6 +-- drivers/media/common/siano/smscoreapi.c | 4 +- drivers/media/common/siano/smsir.c | 2 +- drivers/media/dvb-core/dvb_vb2.c | 2 +- drivers/media/dvb-core/dvbdev.c | 4 +- drivers/media/dvb-frontends/cx24123.c | 2 +- drivers/media/dvb-frontends/cxd2820r_core.c | 2 +- drivers/media/dvb-frontends/dibx000_common.c | 2 +- drivers/media/dvb-frontends/lgdt330x.c | 2 +- drivers/media/dvb-frontends/m88ds3103.c | 2 +- drivers/media/dvb-frontends/rtl2832_sdr.c | 10 ++-- drivers/media/dvb-frontends/s5h1420.c | 2 +- drivers/media/dvb-frontends/tc90522.c | 2 +- drivers/media/dvb-frontends/ts2020.c | 2 +- drivers/media/dvb-frontends/zd1301_demod.c | 3 +- drivers/media/i2c/cs53l32a.c | 2 +- drivers/media/i2c/imx274.c | 2 +- drivers/media/i2c/m5mols/m5mols_core.c | 2 +- drivers/media/i2c/max2175.c | 2 +- drivers/media/i2c/msp3400-driver.c | 2 +- drivers/media/i2c/noon010pc30.c | 2 +- drivers/media/i2c/ov9650.c | 2 +- drivers/media/i2c/s5c73m3/s5c73m3-core.c | 2 +- drivers/media/i2c/s5k4ecgx.c | 2 +- drivers/media/i2c/s5k6aa.c | 2 +- drivers/media/i2c/saa7115.c | 6 +-- drivers/media/i2c/saa7127.c | 4 +- drivers/media/i2c/tvaudio.c | 2 +- drivers/media/i2c/video-i2c.c | 8 +-- drivers/media/media-device.c | 28 +++++----- drivers/media/pci/bt8xx/bttv-driver.c | 6 +-- drivers/media/pci/bt8xx/bttv-i2c.c | 6 +-- drivers/media/pci/bt8xx/bttv-input.c | 2 +- drivers/media/pci/bt8xx/dvb-bt8xx.c | 3 +- drivers/media/pci/cobalt/cobalt-alsa-main.c | 2 +- drivers/media/pci/cobalt/cobalt-alsa-pcm.c | 4 +- drivers/media/pci/cobalt/cobalt-v4l2.c | 14 ++--- drivers/media/pci/cx18/cx18-alsa-main.c | 2 +- drivers/media/pci/cx18/cx18-alsa-pcm.c | 2 +- drivers/media/pci/cx18/cx18-cards.c | 8 +-- drivers/media/pci/cx18/cx18-driver.c | 2 +- drivers/media/pci/cx18/cx18-i2c.c | 2 +- drivers/media/pci/cx18/cx18-ioctl.c | 8 +-- drivers/media/pci/cx23885/cx23885-417.c | 6 +-- drivers/media/pci/cx23885/cx23885-dvb.c | 54 +++++++++---------- drivers/media/pci/cx23885/cx23885-i2c.c | 4 +- drivers/media/pci/cx23885/cx23885-ioctl.c | 4 +- drivers/media/pci/cx23885/cx23885-video.c | 4 +- drivers/media/pci/cx25821/cx25821-i2c.c | 2 +- drivers/media/pci/cx25821/cx25821-video.c | 4 +- drivers/media/pci/cx88/cx88-blackbird.c | 2 +- drivers/media/pci/cx88/cx88-i2c.c | 4 +- drivers/media/pci/cx88/cx88-input.c | 4 +- drivers/media/pci/cx88/cx88-video.c | 4 +- drivers/media/pci/cx88/cx88-vp3054-i2c.c | 2 +- drivers/media/pci/dt3155/dt3155.c | 2 +- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 8 +-- drivers/media/pci/ivtv/ivtv-alsa-main.c | 2 +- drivers/media/pci/ivtv/ivtv-alsa-pcm.c | 2 +- drivers/media/pci/ivtv/ivtv-cards.c | 12 ++--- drivers/media/pci/ivtv/ivtv-i2c.c | 4 +- drivers/media/pci/ivtv/ivtv-ioctl.c | 8 +-- drivers/media/pci/ivtv/ivtvfb.c | 2 +- drivers/media/pci/pt3/pt3.c | 2 +- drivers/media/pci/saa7134/saa7134-empress.c | 2 +- drivers/media/pci/saa7134/saa7134-go7007.c | 2 +- drivers/media/pci/saa7134/saa7134-input.c | 2 +- drivers/media/pci/saa7134/saa7134-video.c | 6 +-- drivers/media/pci/saa7146/mxb.c | 2 +- drivers/media/pci/saa7164/saa7164-dvb.c | 10 ++-- drivers/media/pci/saa7164/saa7164-encoder.c | 4 +- drivers/media/pci/saa7164/saa7164-i2c.c | 2 +- drivers/media/pci/saa7164/saa7164-vbi.c | 2 +- drivers/media/pci/smipcie/smipcie-main.c | 8 +-- drivers/media/pci/solo6x10/solo6x10-v4l2.c | 2 +- drivers/media/pci/ttpci/av7110.c | 3 +- drivers/media/pci/ttpci/budget-core.c | 3 +- drivers/media/pci/tw68/tw68-video.c | 4 +- drivers/media/pci/tw686x/tw686x-audio.c | 8 +-- drivers/media/pci/tw686x/tw686x-video.c | 4 +- drivers/media/platform/am437x/am437x-vpfe.c | 6 +-- drivers/media/platform/atmel/atmel-isc.c | 2 +- drivers/media/platform/atmel/atmel-isi.c | 10 ++-- drivers/media/platform/coda/coda-common.c | 8 +-- drivers/media/platform/davinci/vpbe_display.c | 2 +- drivers/media/platform/davinci/vpfe_capture.c | 6 +-- drivers/media/platform/davinci/vpif_capture.c | 6 +-- drivers/media/platform/davinci/vpif_display.c | 6 +-- drivers/media/platform/exynos-gsc/gsc-core.c | 2 +- drivers/media/platform/exynos-gsc/gsc-m2m.c | 4 +- drivers/media/platform/exynos4-is/common.c | 4 +- .../media/platform/exynos4-is/fimc-capture.c | 2 +- .../media/platform/exynos4-is/fimc-is-i2c.c | 2 +- .../platform/exynos4-is/fimc-isp-video.c | 2 +- drivers/media/platform/exynos4-is/fimc-lite.c | 6 +-- drivers/media/platform/exynos4-is/media-dev.c | 8 +-- drivers/media/platform/m2m-deinterlace.c | 8 +-- .../media/platform/marvell-ccic/mcam-core.c | 6 +-- .../media/platform/marvell-ccic/mmp-driver.c | 2 +- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 4 +- drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c | 6 +-- .../platform/mtk-vcodec/mtk_vcodec_dec.c | 6 +-- .../platform/mtk-vcodec/mtk_vcodec_enc.c | 6 +-- drivers/media/platform/mx2_emmaprp.c | 2 +- drivers/media/platform/omap/omap_vout.c | 10 ++-- drivers/media/platform/omap3isp/isp.c | 2 +- drivers/media/platform/omap3isp/ispccdc.c | 2 +- drivers/media/platform/omap3isp/ispccp2.c | 2 +- drivers/media/platform/omap3isp/ispcsi2.c | 2 +- drivers/media/platform/omap3isp/isppreview.c | 2 +- drivers/media/platform/omap3isp/ispresizer.c | 2 +- drivers/media/platform/omap3isp/ispvideo.c | 8 +-- drivers/media/platform/pxa_camera.c | 8 +-- .../media/platform/qcom/camss/camss-video.c | 8 +-- drivers/media/platform/qcom/camss/camss.c | 2 +- drivers/media/platform/qcom/venus/vdec.c | 8 +-- drivers/media/platform/qcom/venus/venc.c | 8 +-- drivers/media/platform/rcar-vin/rcar-core.c | 4 +- drivers/media/platform/rcar-vin/rcar-v4l2.c | 8 +-- drivers/media/platform/rcar_drif.c | 4 +- drivers/media/platform/rcar_fdp1.c | 6 +-- drivers/media/platform/rcar_jpu.c | 10 ++-- drivers/media/platform/renesas-ceu.c | 6 +-- drivers/media/platform/rockchip/rga/rga.c | 6 +-- .../media/platform/s3c-camif/camif-capture.c | 10 ++-- drivers/media/platform/s3c-camif/camif-core.c | 4 +- drivers/media/platform/s5p-jpeg/jpeg-core.c | 10 ++-- drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 6 +-- drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 6 +-- drivers/media/platform/sh_veu.c | 9 ++-- drivers/media/platform/sh_vou.c | 10 ++-- .../soc_camera/sh_mobile_ceu_camera.c | 6 +-- .../media/platform/soc_camera/soc_camera.c | 6 +-- .../platform/soc_camera/soc_camera_platform.c | 2 +- drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 4 +- drivers/media/platform/sti/delta/delta-v4l2.c | 4 +- drivers/media/platform/sti/hva/hva-v4l2.c | 4 +- drivers/media/platform/stm32/stm32-dcmi.c | 10 ++-- drivers/media/platform/ti-vpe/cal.c | 6 +-- drivers/media/platform/via-camera.c | 4 +- drivers/media/platform/vicodec/vicodec-core.c | 6 +-- drivers/media/platform/vim2m.c | 2 +- drivers/media/platform/vimc/vimc-capture.c | 6 +-- drivers/media/platform/vimc/vimc-common.c | 2 +- drivers/media/platform/vimc/vimc-core.c | 4 +- drivers/media/platform/vivid/vivid-osd.c | 2 +- .../media/platform/vivid/vivid-radio-common.c | 4 +- drivers/media/platform/vivid/vivid-radio-rx.c | 2 +- drivers/media/platform/vivid/vivid-radio-tx.c | 2 +- drivers/media/platform/vivid/vivid-rds-gen.c | 4 +- drivers/media/platform/vivid/vivid-sdr-cap.c | 4 +- drivers/media/platform/vivid/vivid-vid-cap.c | 2 +- drivers/media/platform/vsp1/vsp1_drv.c | 2 +- drivers/media/platform/vsp1/vsp1_histo.c | 4 +- drivers/media/platform/vsp1/vsp1_video.c | 4 +- drivers/media/platform/xilinx/xilinx-dma.c | 6 +-- drivers/media/platform/xilinx/xilinx-tpg.c | 2 +- drivers/media/platform/xilinx/xilinx-vipp.c | 2 +- drivers/media/radio/dsbr100.c | 7 +-- drivers/media/radio/radio-cadet.c | 12 ++--- drivers/media/radio/radio-isa.c | 10 ++-- drivers/media/radio/radio-keene.c | 8 +-- drivers/media/radio/radio-ma901.c | 6 +-- drivers/media/radio/radio-maxiradio.c | 2 +- drivers/media/radio/radio-miropcm20.c | 10 ++-- drivers/media/radio/radio-mr800.c | 6 +-- drivers/media/radio/radio-raremono.c | 8 +-- drivers/media/radio/radio-sf16fmi.c | 12 ++--- drivers/media/radio/radio-sf16fmr2.c | 6 +-- drivers/media/radio/radio-shark.c | 2 +- drivers/media/radio/radio-shark2.c | 2 +- drivers/media/radio/radio-si476x.c | 12 ++--- drivers/media/radio/radio-tea5764.c | 6 +-- drivers/media/radio/radio-tea5777.c | 12 ++--- drivers/media/radio/radio-timb.c | 8 +-- drivers/media/radio/radio-wl1273.c | 12 ++--- drivers/media/radio/si470x/radio-si470x-i2c.c | 4 +- drivers/media/radio/si470x/radio-si470x-usb.c | 4 +- .../radio/si4713/radio-platform-si4713.c | 6 +-- drivers/media/radio/si4713/radio-usb-si4713.c | 6 +-- drivers/media/radio/tea575x.c | 10 ++-- drivers/media/radio/tef6862.c | 2 +- drivers/media/radio/wl128x/fmdrv_v4l2.c | 9 ++-- drivers/media/rc/ati_remote.c | 2 +- drivers/media/rc/mceusb.c | 2 +- drivers/media/rc/streamzap.c | 2 +- drivers/media/tuners/e4000.c | 2 +- drivers/media/tuners/fc2580.c | 2 +- drivers/media/tuners/msi001.c | 2 +- drivers/media/tuners/mt20xx.c | 2 +- drivers/media/tuners/tuner-simple.c | 2 +- drivers/media/usb/airspy/airspy.c | 10 ++-- drivers/media/usb/au0828/au0828-i2c.c | 2 +- drivers/media/usb/au0828/au0828-video.c | 4 +- drivers/media/usb/cx231xx/cx231xx-417.c | 2 +- drivers/media/usb/cx231xx/cx231xx-input.c | 2 +- drivers/media/usb/cx231xx/cx231xx-video.c | 18 +++---- drivers/media/usb/dvb-usb-v2/af9035.c | 2 +- drivers/media/usb/dvb-usb-v2/anysee.c | 2 +- drivers/media/usb/dvb-usb-v2/dvb_usb_core.c | 2 +- drivers/media/usb/dvb-usb-v2/gl861.c | 2 +- drivers/media/usb/dvb-usb-v2/lmedm04.c | 2 +- drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 18 +++---- drivers/media/usb/dvb-usb-v2/zd1301.c | 2 +- drivers/media/usb/dvb-usb/cxusb.c | 4 +- drivers/media/usb/dvb-usb/dib0700_devices.c | 4 +- drivers/media/usb/dvb-usb/dvb-usb-i2c.c | 2 +- drivers/media/usb/dvb-usb/dw2102.c | 4 +- drivers/media/usb/dvb-usb/technisat-usb2.c | 5 +- drivers/media/usb/em28xx/em28xx-video.c | 10 ++-- drivers/media/usb/go7007/go7007-driver.c | 2 +- drivers/media/usb/go7007/go7007-v4l2.c | 16 +++--- drivers/media/usb/go7007/snd-go7007.c | 8 +-- drivers/media/usb/gspca/gspca.c | 10 ++-- drivers/media/usb/gspca/sn9c20x.c | 2 +- drivers/media/usb/hackrf/hackrf.c | 12 ++--- drivers/media/usb/hdpvr/hdpvr-video.c | 2 +- drivers/media/usb/msi2500/msi2500.c | 8 +-- drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c | 6 +-- drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 10 ++-- drivers/media/usb/pwc/pwc-v4l.c | 10 ++-- drivers/media/usb/s2255/s2255drv.c | 10 ++-- drivers/media/usb/stk1160/stk1160-v4l.c | 2 +- drivers/media/usb/tm6000/tm6000-i2c.c | 4 +- drivers/media/usb/tm6000/tm6000-video.c | 7 +-- drivers/media/usb/usbtv/usbtv-audio.c | 6 +-- drivers/media/usb/usbtv/usbtv-video.c | 14 ++--- drivers/media/usb/usbvision/usbvision-video.c | 4 +- drivers/media/usb/uvc/uvc_ctrl.c | 4 +- drivers/media/usb/uvc/uvc_driver.c | 20 +++---- drivers/media/usb/uvc/uvc_entity.c | 2 +- drivers/media/usb/uvc/uvc_metadata.c | 4 +- drivers/media/usb/uvc/uvc_v4l2.c | 10 ++-- drivers/media/usb/zr364xx/zr364xx.c | 6 +-- drivers/media/v4l2-core/v4l2-common.c | 6 +-- drivers/media/v4l2-core/v4l2-ctrls.c | 8 +-- drivers/media/v4l2-core/v4l2-device.c | 2 +- .../media/v4l2-core/v4l2-flash-led-class.c | 2 +- drivers/media/v4l2-core/v4l2-ioctl.c | 8 +-- drivers/media/v4l2-core/v4l2-subdev.c | 2 +- drivers/staging/media/bcm2048/radio-bcm2048.c | 4 +- .../staging/media/davinci_vpfe/dm365_ipipe.c | 2 +- .../media/davinci_vpfe/dm365_ipipeif.c | 2 +- .../staging/media/davinci_vpfe/dm365_isif.c | 2 +- .../media/davinci_vpfe/dm365_resizer.c | 6 +-- .../staging/media/davinci_vpfe/vpfe_video.c | 6 +-- drivers/staging/media/imx/imx-media-capture.c | 4 +- drivers/staging/media/imx/imx-media-dev.c | 4 +- drivers/staging/media/omap4iss/iss.c | 2 +- drivers/staging/media/omap4iss/iss_ipipe.c | 2 +- drivers/staging/media/omap4iss/iss_ipipeif.c | 2 +- drivers/staging/media/omap4iss/iss_resizer.c | 2 +- drivers/staging/media/omap4iss/iss_video.c | 10 ++-- drivers/staging/media/zoran/zoran_card.c | 4 +- drivers/staging/media/zoran/zoran_driver.c | 4 +- 260 files changed, 676 insertions(+), 665 deletions(-)
drivers/media/cec/cec-api.c +2 -2
@@ -77,9 +77,9 @@ static long cec_adap_g_caps(struct cec_adapter *adap, {struct cec_caps caps = {}; -strlcpy (caps.driver, adap->devnode.dev.parent->driver->name, +strscpy (caps.driver, adap->devnode.dev.parent->driver->name,sizeof (caps.driver)); -strlcpy (caps.name, adap->name,sizeof (caps.name)); +strscpy (caps.name, adap->name,sizeof (caps.name)); caps.available_log_addrs = adap->available_log_addrs; caps.capabilities = adap->capabilities; caps.version =LINUX_VERSION_CODE ;
drivers/media/cec/cec-core.c +1 -1
@@ -264,7 +264,7 @@ struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops, adap =kzalloc (sizeof (*adap),GFP_KERNEL );if (!adap)return ERR_PTR (-ENOMEM ); -strlcpy (adap->name, name,sizeof (adap->name)); +strscpy (adap->name, name,sizeof (adap->name)); adap->phys_addr =CEC_PHYS_ADDR_INVALID ; adap->cec_pin_is_high = true; adap->log_addrs.cec_version =CEC_OP_CEC_VERSION_2_0 ;
drivers/media/common/b2c2/flexcop-i2c.c +6 -6
@@ -226,12 +226,12 @@ int flexcop_i2c_init(struct flexcop_device *fc) fc->fc_i2c_adap[1 ].port =FC_I2C_PORT_EEPROM ; fc->fc_i2c_adap[2 ].port =FC_I2C_PORT_TUNER ; -strlcpy (fc->fc_i2c_adap[0 ].i2c_adap.name,"B2C2 FlexCop I2C to demod" , -sizeof (fc->fc_i2c_adap[0 ].i2c_adap.name)); -strlcpy (fc->fc_i2c_adap[1 ].i2c_adap.name,"B2C2 FlexCop I2C to eeprom" , -sizeof (fc->fc_i2c_adap[1 ].i2c_adap.name)); -strlcpy (fc->fc_i2c_adap[2 ].i2c_adap.name,"B2C2 FlexCop I2C to tuner" , -sizeof (fc->fc_i2c_adap[2 ].i2c_adap.name)); +strscpy (fc->fc_i2c_adap[0 ].i2c_adap.name,"B2C2 FlexCop I2C to demod" , +sizeof (fc->fc_i2c_adap[0 ].i2c_adap.name)); +strscpy (fc->fc_i2c_adap[1 ].i2c_adap.name,"B2C2 FlexCop I2C to eeprom" , +sizeof (fc->fc_i2c_adap[1 ].i2c_adap.name)); +strscpy (fc->fc_i2c_adap[2 ].i2c_adap.name,"B2C2 FlexCop I2C to tuner" , +sizeof (fc->fc_i2c_adap[2 ].i2c_adap.name));i2c_set_adapdata (&fc->fc_i2c_adap[0 ].i2c_adap, &fc->fc_i2c_adap[0 ]);i2c_set_adapdata (&fc->fc_i2c_adap[1 ].i2c_adap, &fc->fc_i2c_adap[1 ]);
drivers/media/common/cx2341x.c +1 -1
@@ -569,7 +569,7 @@ static int cx2341x_ctrl_query_fill(struct v4l2_queryctrl *qctrl, qctrl->step = step; qctrl->default_value = def; qctrl->reserved[0 ] = qctrl->reserved[1 ] =0 ; -strlcpy (qctrl->name, name,sizeof (qctrl->name)); +strscpy (qctrl->name, name,sizeof (qctrl->name));return 0 ;default :
drivers/media/common/saa7146/saa7146_fops.c +1 -1
@@ -606,7 +606,7 @@ int saa7146_register_device(struct video_device *vfd, struct saa7146_dev *dev, vfd->tvnorms =0 ;for (i =0 ; i < dev->ext_vv_data->num_stds; i++) vfd->tvnorms |= dev->ext_vv_data->stds[i].id; -strlcpy (vfd->name, name,sizeof (vfd->name)); +strscpy (vfd->name, name,sizeof (vfd->name));video_set_drvdata (vfd, dev); err =video_register_device (vfd, type,-1 );
drivers/media/common/saa7146/saa7146_video.c +3 -3
@@ -452,7 +452,7 @@ static int vidioc_querycap(struct file *file, void *fh, struct v4l2_capability *struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;strcpy ((char *)cap->driver,"saa7146 v4l2" ); -strlcpy ((char *)cap->card, dev->ext->name,sizeof (cap->card)); +strscpy ((char *)cap->card, dev->ext->name,sizeof (cap->card));sprintf ((char *)cap->bus_info,"PCI:%s" ,pci_name (dev->pci)); cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
@@ -525,8 +525,8 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *fh, struct v4l2_fmtd {if (f->index >=ARRAY_SIZE (formats))return -EINVAL ; -strlcpy ((char *)f->description, formats[f->index].name, -sizeof (f->description)); +strscpy ((char *)f->description, formats[f->index].name, +sizeof (f->description)); f->pixelformat = formats[f->index].pixelformat;return 0 ; }
drivers/media/common/siano/smscoreapi.c +2 -2
@@ -450,7 +450,7 @@ static struct smscore_registry_entry_t *smscore_find_registry(char *devpath) entry =kmalloc (sizeof (*entry),GFP_KERNEL );if (entry) { entry->mode = default_mode; -strlcpy (entry->devpath, devpath,sizeof (entry->devpath)); +strscpy (entry->devpath, devpath,sizeof (entry->devpath));list_add (&entry->entry, &g_smscore_registry); }else pr_err ("failed to create smscore_registry.\n" );
@@ -735,7 +735,7 @@ int smscore_register_device(struct smsdevice_params_t *params, dev->postload_handler = params->postload_handler; dev->device_flags = params->flags; -strlcpy (dev->devpath, params->devpath,sizeof (dev->devpath)); +strscpy (dev->devpath, params->devpath,sizeof (dev->devpath));smscore_registry_settype (dev->devpath, params->device_type);
drivers/media/common/siano/smsir.c +1 -1
@@ -55,7 +55,7 @@ int sms_ir_init(struct smscore_device_t *coredev)snprintf (coredev->ir.name,sizeof (coredev->ir.name),"SMS IR (%s)" ,sms_get_board (board_id)->name); -strlcpy (coredev->ir.phys, coredev->devpath,sizeof (coredev->ir.phys)); +strscpy (coredev->ir.phys, coredev->devpath,sizeof (coredev->ir.phys));strlcat (coredev->ir.phys,"/ir0" ,sizeof (coredev->ir.phys)); dev->device_name = coredev->ir.name;
drivers/media/dvb-core/dvb_vb2.c +1 -1
@@ -194,7 +194,7 @@ int dvb_vb2_init(struct dvb_vb2_ctx *ctx, const char *name, int nonblocking)spin_lock_init (&ctx->slock);INIT_LIST_HEAD (&ctx->dvb_q); -strlcpy (ctx->name, name,DVB_VB2_NAME_MAX ); +strscpy (ctx->name, name,DVB_VB2_NAME_MAX ); ctx->nonblocking = nonblocking; ctx->state =DVB_VB2_STATE_INIT ;
drivers/media/dvb-core/dvbdev.c +2 -2
@@ -967,9 +967,9 @@ struct i2c_client *dvb_module_probe(const char *module_name,return NULL ;if (name) -strlcpy (board_info->type, name,I2C_NAME_SIZE ); +strscpy (board_info->type, name,I2C_NAME_SIZE );else -strlcpy (board_info->type, module_name,I2C_NAME_SIZE ); +strscpy (board_info->type, module_name,I2C_NAME_SIZE ); board_info->addr = addr; board_info->platform_data = platform_data;
drivers/media/dvb-frontends/cx24123.c +1 -1
@@ -1087,7 +1087,7 @@ struct dvb_frontend *cx24123_attach(const struct cx24123_config *config,if (config->dont_use_pll)cx24123_repeater_mode (state,1 ,0 ); -strlcpy (state->tuner_i2c_adapter.name,"CX24123 tuner I2C bus" , +strscpy (state->tuner_i2c_adapter.name,"CX24123 tuner I2C bus" ,sizeof (state->tuner_i2c_adapter.name)); state->tuner_i2c_adapter.algo = &cx24123_tuner_i2c_algo; state->tuner_i2c_adapter.algo_data =NULL ;
drivers/media/dvb-frontends/cxd2820r_core.c +1 -1
@@ -540,7 +540,7 @@ struct dvb_frontend *cxd2820r_attach(const struct cxd2820r_config *config, pdata.attach_in_use = true;memset (&board_info,0 ,sizeof (board_info)); -strlcpy (board_info.type,"cxd2820r" ,I2C_NAME_SIZE ); +strscpy (board_info.type,"cxd2820r" ,I2C_NAME_SIZE ); board_info.addr = config->i2c_address; board_info.platform_data = &pdata; client =i2c_new_device (adapter, &board_info);
drivers/media/dvb-frontends/dibx000_common.c +1 -1
@@ -424,7 +424,7 @@ static int i2c_adapter_init(struct i2c_adapter *i2c_adap, struct i2c_algorithm *algo, const char *name, struct dibx000_i2c_master *mst) { - strlcpy(i2c_adap->name, name, sizeof(i2c_adap->name)); + strscpy(i2c_adap->name, name, sizeof(i2c_adap->name)); i2c_adap->algo = algo; i2c_adap->algo_data =NULL ;i2c_set_adapdata (i2c_adap, mst);
drivers/media/dvb-frontends/lgdt330x.c +1 -1
@@ -929,7 +929,7 @@ struct dvb_frontend *lgdt330x_attach(const struct lgdt330x_config *_config,struct i2c_board_info board_info = {};struct lgdt330x_config config = *_config; -strlcpy (board_info.type,"lgdt330x" ,sizeof (board_info.type)); +strscpy (board_info.type,"lgdt330x" ,sizeof (board_info.type)); board_info.addr = demod_address; board_info.platform_data = &config; client =i2c_new_device (i2c, &board_info);
drivers/media/dvb-frontends/m88ds3103.c +1 -1
@@ -1284,7 +1284,7 @@ struct dvb_frontend *m88ds3103_attach(const struct m88ds3103_config *cfg, pdata.attach_in_use = true;memset (&board_info,0 ,sizeof (board_info)); -strlcpy (board_info.type,"m88ds3103" ,I2C_NAME_SIZE ); +strscpy (board_info.type,"m88ds3103" ,I2C_NAME_SIZE ); board_info.addr = cfg->i2c_addr; board_info.platform_data = &pdata; client =i2c_new_device (i2c, &board_info);
drivers/media/dvb-frontends/rtl2832_sdr.c +5 -5
@@ -439,8 +439,8 @@ static int rtl2832_sdr_querycap(struct file *file, void *fh,dev_dbg (&pdev->dev,"\n" ); -strlcpy (cap->driver,KBUILD_MODNAME ,sizeof (cap->driver)); -strlcpy (cap->card, dev->vdev.name,sizeof (cap->card)); +strscpy (cap->driver,KBUILD_MODNAME ,sizeof (cap->driver)); +strscpy (cap->card, dev->vdev.name,sizeof (cap->card));usb_make_path (dev->udev, cap->bus_info,sizeof (cap->bus_info)); cap->device_caps =V4L2_CAP_SDR_CAPTURE |V4L2_CAP_STREAMING |V4L2_CAP_READWRITE |V4L2_CAP_TUNER ;
@@ -976,7 +976,7 @@ static int rtl2832_sdr_g_tuner(struct file *file, void *priv,dev_dbg (&pdev->dev,"index=%d type=%d\n" , v->index, v->type);if (v->index ==0 ) { -strlcpy (v->name,"ADC: Realtek RTL2832" ,sizeof (v->name)); +strscpy (v->name,"ADC: Realtek RTL2832" ,sizeof (v->name)); v->type =V4L2_TUNER_ADC ; v->capability =V4L2_TUNER_CAP_1HZ |V4L2_TUNER_CAP_FREQ_BANDS ; v->rangelow =300000 ;
@@ -986,7 +986,7 @@ static int rtl2832_sdr_g_tuner(struct file *file, void *priv, V4L2_SUBDEV_HAS_OP(dev->v4l2_subdev, tuner, g_tuner)) { ret =v4l2_subdev_call (dev->v4l2_subdev, tuner, g_tuner, v); } else if (v->index == 1) { -strlcpy (v->name,"RF: <unknown>" ,sizeof (v->name)); +strscpy (v->name,"RF: <unknown>" ,sizeof (v->name)); v->type =V4L2_TUNER_RF ; v->capability =V4L2_TUNER_CAP_1HZ |V4L2_TUNER_CAP_FREQ_BANDS ; v->rangelow =50000000 ;
@@ -1133,7 +1133,7 @@ static int rtl2832_sdr_enum_fmt_sdr_cap(struct file *file, void *priv,if (f->index >= dev->num_formats)return -EINVAL ; -strlcpy (f->description, formats[f->index].name,sizeof (f->description)); +strscpy (f->description, formats[f->index].name,sizeof (f->description)); f->pixelformat = formats[f->index].pixelformat;return 0 ;
drivers/media/dvb-frontends/s5h1420.c +1 -1
@@ -912,7 +912,7 @@ struct dvb_frontend *s5h1420_attach(const struct s5h1420_config *config, state->frontend.demodulator_priv = state;/* create tuner i2c adapter */ -strlcpy (state->tuner_i2c_adapter.name,"S5H1420-PN1010 tuner I2C bus" , +strscpy (state->tuner_i2c_adapter.name,"S5H1420-PN1010 tuner I2C bus" ,sizeof (state->tuner_i2c_adapter.name)); state->tuner_i2c_adapter.algo = &s5h1420_tuner_i2c_algo; state->tuner_i2c_adapter.algo_data =NULL ;
drivers/media/dvb-frontends/tc90522.c +1 -1
@@ -781,7 +781,7 @@ static int tc90522_probe(struct i2c_client *client, adap->owner =THIS_MODULE ; adap->algo = &tc90522_tuner_i2c_algo; adap->dev.parent = &client->dev; -strlcpy (adap->name,"tc90522_sub" ,sizeof (adap->name)); +strscpy (adap->name,"tc90522_sub" ,sizeof (adap->name));i2c_set_adapdata (adap, state); ret =i2c_add_adapter (adap);if (ret <0 )
drivers/media/dvb-frontends/ts2020.c +1 -1
@@ -525,7 +525,7 @@ struct dvb_frontend *ts2020_attach(struct dvb_frontend *fe, pdata.attach_in_use = true;memset (&board_info,0 ,sizeof (board_info)); -strlcpy (board_info.type,"ts2020" ,I2C_NAME_SIZE ); +strscpy (board_info.type,"ts2020" ,I2C_NAME_SIZE ); board_info.addr = config->tuner_address; board_info.platform_data = &pdata; client =i2c_new_device (i2c, &board_info);
drivers/media/dvb-frontends/zd1301_demod.c +2 -1
@@ -499,7 +499,8 @@ static int zd1301_demod_probe(struct platform_device *pdev) goto err_kfree;/* Create I2C adapter */ -strlcpy (dev->adapter.name,"ZyDAS ZD1301 demod" ,sizeof (dev->adapter.name)); +strscpy (dev->adapter.name,"ZyDAS ZD1301 demod" , +sizeof (dev->adapter.name)); dev->adapter.algo = &zd1301_demod_i2c_algorithm; dev->adapter.algo_data =NULL ; dev->adapter.dev.parent = pdev->dev.parent;
drivers/media/i2c/cs53l32a.c +1 -1
@@ -149,7 +149,7 @@ static int cs53l32a_probe(struct i2c_client *client,return -EIO ;if (!id) -strlcpy (client->name,"cs53l32a" ,sizeof (client->name)); +strscpy (client->name,"cs53l32a" ,sizeof (client->name));v4l_info (client,"chip found @ 0x%x (%s)\n" , client->addr <<1 , client->adapter->name);
drivers/media/i2c/imx274.c +1 -1
@@ -1895,7 +1895,7 @@ static int imx274_probe(struct i2c_client *client, imx274->client = client; sd = &imx274->sd;v4l2_i2c_subdev_init (sd, client, &imx274_subdev_ops); -strlcpy (sd->name,DRIVER_NAME ,sizeof (sd->name)); +strscpy (sd->name,DRIVER_NAME ,sizeof (sd->name)); sd->flags |=V4L2_SUBDEV_FL_HAS_DEVNODE |V4L2_SUBDEV_FL_HAS_EVENTS ;/* initialize subdev media pad */
drivers/media/i2c/m5mols/m5mols_core.c +1 -1
@@ -987,7 +987,7 @@ static int m5mols_probe(struct i2c_client *client, sd = &info->sd;v4l2_i2c_subdev_init (sd, client, &m5mols_ops); -strlcpy (sd->name,MODULE_NAME ,sizeof (sd->name)); +strscpy (sd->name,MODULE_NAME ,sizeof (sd->name)); sd->flags |=V4L2_SUBDEV_FL_HAS_DEVNODE ; sd->internal_ops = &m5mols_subdev_internal_ops;
drivers/media/i2c/max2175.c +1 -1
@@ -1165,7 +1165,7 @@ static int max2175_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)if (vt->index >0 )return -EINVAL ; -strlcpy (vt->name,"RF" ,sizeof (vt->name)); +strscpy (vt->name,"RF" ,sizeof (vt->name)); vt->type =V4L2_TUNER_RF ; vt->capability =V4L2_TUNER_CAP_1HZ |V4L2_TUNER_CAP_FREQ_BANDS ; vt->rangelow = ctx->bands_rf->rangelow;
drivers/media/i2c/msp3400-driver.c +1 -1
@@ -688,7 +688,7 @@ static int msp_probe(struct i2c_client *client, const struct i2c_device_id *id)#endif if (!id) -strlcpy (client->name,"msp3400" ,sizeof (client->name)); +strscpy (client->name,"msp3400" ,sizeof (client->name));if (msp_reset (client) ==-1 ) {dev_dbg_lvl (&client->dev,1 , msp_debug,"msp3400 not found\n" );
drivers/media/i2c/noon010pc30.c +1 -1
@@ -720,7 +720,7 @@ static int noon010_probe(struct i2c_client *client,mutex_init (&info->lock); sd = &info->sd;v4l2_i2c_subdev_init (sd, client, &noon010_ops); -strlcpy (sd->name,MODULE_NAME ,sizeof (sd->name)); +strscpy (sd->name,MODULE_NAME ,sizeof (sd->name)); sd->internal_ops = &noon010_subdev_internal_ops; sd->flags |=V4L2_SUBDEV_FL_HAS_DEVNODE ;
drivers/media/i2c/ov9650.c +1 -1
@@ -1539,7 +1539,7 @@ static int ov965x_probe(struct i2c_client *client, sd = &ov965x->sd;v4l2_i2c_subdev_init (sd, client, &ov965x_subdev_ops); -strlcpy (sd->name,DRIVER_NAME ,sizeof (sd->name)); +strscpy (sd->name,DRIVER_NAME ,sizeof (sd->name)); sd->internal_ops = &ov965x_sd_internal_ops; sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE |
drivers/media/i2c/s5c73m3/s5c73m3-core.c +1 -1
@@ -1683,7 +1683,7 @@ static int s5c73m3_probe(struct i2c_client *client,v4l2_subdev_init (sd, &s5c73m3_subdev_ops); sd->owner = client->dev.driver->owner;v4l2_set_subdevdata (sd, state); -strlcpy (sd->name,"S5C73M3" ,sizeof (sd->name)); +strscpy (sd->name,"S5C73M3" ,sizeof (sd->name)); sd->internal_ops = &s5c73m3_internal_ops; sd->flags |=V4L2_SUBDEV_FL_HAS_DEVNODE ;
drivers/media/i2c/s5k4ecgx.c +1 -1
@@ -954,7 +954,7 @@ static int s5k4ecgx_probe(struct i2c_client *client, sd = &priv->sd;/* Registering subdev */ v4l2_i2c_subdev_init (sd, client, &s5k4ecgx_ops); -strlcpy (sd->name,S5K4ECGX_DRIVER_NAME ,sizeof (sd->name)); +strscpy (sd->name,S5K4ECGX_DRIVER_NAME ,sizeof (sd->name)); sd->internal_ops = &s5k4ecgx_subdev_internal_ops;/* Support v4l2 sub-device user space API */
drivers/media/i2c/s5k6aa.c +1 -1
@@ -1576,7 +1576,7 @@ static int s5k6aa_probe(struct i2c_client *client, sd = &s5k6aa->sd;v4l2_i2c_subdev_init (sd, client, &s5k6aa_subdev_ops); -strlcpy (sd->name,DRIVER_NAME ,sizeof (sd->name)); +strscpy (sd->name,DRIVER_NAME ,sizeof (sd->name)); sd->internal_ops = &s5k6aa_subdev_internal_ops; sd->flags |=V4L2_SUBDEV_FL_HAS_DEVNODE ;
drivers/media/i2c/saa7115.c +3 -3
@@ -1765,7 +1765,7 @@ static int saa711x_detect_chip(struct i2c_client *client,* the lower nibble is a gm7113c. */ -strlcpy (name,"gm7113c" ,CHIP_VER_SIZE ); +strscpy (name,"gm7113c" ,CHIP_VER_SIZE );if (!autodetect &&strcmp (name, id->name))return -EINVAL ;
@@ -1779,7 +1779,7 @@ static int saa711x_detect_chip(struct i2c_client *client,/* Check if it is a CJC7113 */ if (!memcmp (name,"1111111111111111" ,CHIP_VER_SIZE )) { -strlcpy (name,"cjc7113" ,CHIP_VER_SIZE ); +strscpy (name,"cjc7113" ,CHIP_VER_SIZE );if (!autodetect &&strcmp (name, id->name))return -EINVAL ;
@@ -1825,7 +1825,7 @@ static int saa711x_probe(struct i2c_client *client,if (ident <0 )return ident; -strlcpy (client->name, name,sizeof (client->name)); +strscpy (client->name, name,sizeof (client->name)); state =devm_kzalloc (&client->dev,sizeof (*state),GFP_KERNEL );if (state ==NULL )
drivers/media/i2c/saa7127.c +2 -2
@@ -761,10 +761,10 @@ static int saa7127_probe(struct i2c_client *client,saa7127_write (sd,SAA7129_REG_FADE_KEY_COL2 , read_result); state->ident =SAA7129 ; -strlcpy (client->name,"saa7129" ,I2C_NAME_SIZE ); +strscpy (client->name,"saa7129" ,I2C_NAME_SIZE ); }else { state->ident =SAA7127 ; -strlcpy (client->name,"saa7127" ,I2C_NAME_SIZE ); +strscpy (client->name,"saa7127" ,I2C_NAME_SIZE ); } }
drivers/media/i2c/tvaudio.c +1 -1
@@ -1981,7 +1981,7 @@ static int tvaudio_probe(struct i2c_client *client, const struct i2c_device_id */* fill required data structures */ if (!id) -strlcpy (client->name, desc->name,I2C_NAME_SIZE ); +strscpy (client->name, desc->name,I2C_NAME_SIZE ); chip->desc = desc; chip->shadow.count = desc->registers+1 ; chip->prevmode =-1 ;
drivers/media/i2c/video-i2c.c +4 -4
@@ -352,8 +352,8 @@ static int video_i2c_querycap(struct file *file, void *priv,struct video_i2c_data *data =video_drvdata (file);struct i2c_client *client = data->client; -strlcpy (vcap->driver, data->v4l2_dev.name,sizeof (vcap->driver)); -strlcpy (vcap->card, data->vdev.name,sizeof (vcap->card)); +strscpy (vcap->driver, data->v4l2_dev.name,sizeof (vcap->driver)); +strscpy (vcap->card, data->vdev.name,sizeof (vcap->card));sprintf (vcap->bus_info,"I2C:%d-%d" , client->adapter->nr, client->addr);
@@ -378,7 +378,7 @@ static int video_i2c_enum_input(struct file *file, void *fh,if (vin->index >0 )return -EINVAL ; -strlcpy (vin->name,"Camera" ,sizeof (vin->name)); +strscpy (vin->name,"Camera" ,sizeof (vin->name)); vin->type =V4L2_INPUT_TYPE_CAMERA ;
@@ -534,7 +534,7 @@ static int video_i2c_probe(struct i2c_client *client, data->client = client; v4l2_dev = &data->v4l2_dev; -strlcpy (v4l2_dev->name,VIDEO_I2C_DRIVER ,sizeof (v4l2_dev->name)); +strscpy (v4l2_dev->name,VIDEO_I2C_DRIVER ,sizeof (v4l2_dev->name)); ret =v4l2_device_register (&client->dev, v4l2_dev);if (ret <0 )
drivers/media/media-device.c +14 -14
@@ -69,14 +69,14 @@ static long media_device_get_info(struct media_device *dev, void *arg)memset (info,0 ,sizeof (*info));if (dev->driver_name[0 ]) -strlcpy (info->driver, dev->driver_name,sizeof (info->driver)); +strscpy (info->driver, dev->driver_name,sizeof (info->driver));else -strlcpy (info->driver, dev->dev->driver->name, +strscpy (info->driver, dev->dev->driver->name,sizeof (info->driver)); -strlcpy (info->model, dev->model,sizeof (info->model)); -strlcpy (info->serial, dev->serial,sizeof (info->serial)); -strlcpy (info->bus_info, dev->bus_info,sizeof (info->bus_info)); +strscpy (info->model, dev->model,sizeof (info->model)); +strscpy (info->serial, dev->serial,sizeof (info->serial)); +strscpy (info->bus_info, dev->bus_info,sizeof (info->bus_info)); info->media_version =LINUX_VERSION_CODE ; info->driver_version = info->media_version;
@@ -115,7 +115,7 @@ static long media_device_enum_entities(struct media_device *mdev, void *arg) entd->id =media_entity_id (ent);if (ent->name) -strlcpy (entd->name, ent->name,sizeof (entd->name)); +strscpy (entd->name, ent->name,sizeof (entd->name)); entd->type = ent->function; entd->revision =0 ;/* Unused */ entd->flags = ent->flags;
@@ -268,7 +268,7 @@ static long media_device_get_topology(struct media_device *mdev, void *arg) kentity.id = entity->graph_obj.id; kentity.function = entity->function; kentity.flags = entity->flags; -strlcpy (kentity.name, entity->name, +strscpy (kentity.name, entity->name,sizeof (kentity.name));if (copy_to_user (uentity, &kentity,sizeof (kentity)))
@@ -836,9 +836,9 @@ void media_device_pci_init(struct media_device *mdev, mdev->dev = &pci_dev->dev;if (name) -strlcpy (mdev->model, name,sizeof (mdev->model)); +strscpy (mdev->model, name,sizeof (mdev->model));else -strlcpy (mdev->model,pci_name (pci_dev),sizeof (mdev->model)); +strscpy (mdev->model,pci_name (pci_dev),sizeof (mdev->model));sprintf (mdev->bus_info,"PCI:%s" ,pci_name (pci_dev));
@@ -859,17 +859,17 @@ void __media_device_usb_init(struct media_device *mdev, mdev->dev = &udev->dev;if (driver_name) -strlcpy (mdev->driver_name, driver_name, +strscpy (mdev->driver_name, driver_name,sizeof (mdev->driver_name));if (board_name) -strlcpy (mdev->model, board_name,sizeof (mdev->model)); +strscpy (mdev->model, board_name,sizeof (mdev->model));else if (udev->product) -strlcpy (mdev->model, udev->product,sizeof (mdev->model)); +strscpy (mdev->model, udev->product,sizeof (mdev->model));else -strlcpy (mdev->model,"unknown model" ,sizeof (mdev->model)); +strscpy (mdev->model,"unknown model" ,sizeof (mdev->model));if (udev->serial) -strlcpy (mdev->serial, udev->serial,sizeof (mdev->serial)); +strscpy (mdev->serial, udev->serial,sizeof (mdev->serial));usb_make_path (udev, mdev->bus_info,sizeof (mdev->bus_info)); mdev->hw_revision =le16_to_cpu (udev->descriptor.bcdDevice);
drivers/media/pci/bt8xx/bttv-driver.c +3 -3
@@ -2473,8 +2473,8 @@ static int bttv_querycap(struct file *file, void *priv,if (0 == v4l2)return -EINVAL ; -strlcpy (cap->driver,"bttv" ,sizeof (cap->driver)); -strlcpy (cap->card, btv->video_dev.name,sizeof (cap->card)); +strscpy (cap->driver,"bttv" ,sizeof (cap->driver)); +strscpy (cap->card, btv->video_dev.name,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"PCI:%s" ,pci_name (btv->c.pci)); cap->capabilities =
@@ -2535,7 +2535,7 @@ static int bttv_enum_fmt_cap_ovr(struct v4l2_fmtdesc *f)return -EINVAL ; f->pixelformat = formats[i].fourcc; -strlcpy (f->description, formats[i].name,sizeof (f->description)); +strscpy (f->description, formats[i].name,sizeof (f->description));return i; }
drivers/media/pci/bt8xx/bttv-i2c.c +3 -3
@@ -347,13 +347,13 @@ static void do_i2c_scan(char *name, struct i2c_client *c)/* init + register i2c adapter */ int init_bttv_i2c (struct bttv *btv) { -strlcpy (btv->i2c_client.name,"bttv internal" ,I2C_NAME_SIZE ); +strscpy (btv->i2c_client.name,"bttv internal" ,I2C_NAME_SIZE );if (i2c_hw) btv->use_i2c_hw =1 ;if (btv->use_i2c_hw) {/* bt878 */ -strlcpy (btv->c.i2c_adap.name,"bt878" , +strscpy (btv->c.i2c_adap.name,"bt878" ,sizeof (btv->c.i2c_adap.name)); btv->c.i2c_adap.algo = &bttv_algo; }else {
@@ -362,7 +362,7 @@ int init_bttv_i2c(struct bttv *btv)if (i2c_udelay<5 ) i2c_udelay=5 ; -strlcpy (btv->c.i2c_adap.name,"bttv" , +strscpy (btv->c.i2c_adap.name,"bttv" ,sizeof (btv->c.i2c_adap.name)); btv->i2c_algo = bttv_i2c_algo_bit_template; btv->i2c_algo.udelay = i2c_udelay;
drivers/media/pci/bt8xx/bttv-input.c +1 -1
@@ -382,7 +382,7 @@ void init_bttv_i2c_ir(struct bttv *btv)memset (&info,0 ,sizeof (struct i2c_board_info ));memset (&btv->init_data,0 ,sizeof (btv->init_data)); -strlcpy (info.type,"ir_video" ,I2C_NAME_SIZE ); +strscpy (info.type,"ir_video" ,I2C_NAME_SIZE );switch (btv->c.type) {case BTTV_BOARD_PV951 :
drivers/media/pci/bt8xx/dvb-bt8xx.c +2 -1
@@ -819,7 +819,8 @@ static int dvb_bt8xx_probe(struct bttv_sub_device *sub)mutex_init (&card->lock); card->bttv_nr = sub->core->nr; -strlcpy (card->card_name, sub->core->v4l2_dev.name,sizeof (card->card_name)); +strscpy (card->card_name, sub->core->v4l2_dev.name, +sizeof (card->card_name)); card->i2c_adapter = &sub->core->i2c_adap;switch (sub->core->type) {
drivers/media/pci/cobalt/cobalt-alsa-main.c +1 -1
@@ -65,7 +65,7 @@ static int snd_cobalt_card_set_names(struct snd_cobalt_card *cobsc)struct snd_card *sc = cobsc->sc;/* sc->driver is used by alsa-lib's configurator: simple, unique */ -strlcpy (sc->driver,"cobalt" ,sizeof (sc->driver)); +strscpy (sc->driver,"cobalt" ,sizeof (sc->driver));/* sc->shortname is a symlink in /proc/asound: COBALT-M -> cardN */ snprintf(sc->shortname, sizeof(sc->shortname), "cobalt-%d-%d",
drivers/media/pci/cobalt/cobalt-alsa-pcm.c +2 -2
@@ -557,7 +557,7 @@ int snd_cobalt_pcm_create(struct snd_cobalt_card *cobsc) &snd_cobalt_pcm_capture_ops); sp->info_flags =0 ; sp->private_data = cobsc; -strlcpy (sp->name,"cobalt" ,sizeof (sp->name)); +strscpy (sp->name,"cobalt" ,sizeof (sp->name)); }else {cobalt_s_bit_sysctrl (cobalt,COBALT_SYS_CTRL_AUDIO_OPP_RESETN_BIT ,0 );
@@ -581,7 +581,7 @@ int snd_cobalt_pcm_create(struct snd_cobalt_card *cobsc) &snd_cobalt_pcm_playback_ops); sp->info_flags =0 ; sp->private_data = cobsc; -strlcpy (sp->name,"cobalt" ,sizeof (sp->name)); +strscpy (sp->name,"cobalt" ,sizeof (sp->name)); }return 0 ;
drivers/media/pci/cobalt/cobalt-v4l2.c +7 -7
@@ -479,8 +479,8 @@ static int cobalt_querycap(struct file *file, void *priv_fh,struct cobalt_stream *s =video_drvdata (file);struct cobalt *cobalt = s->cobalt; -strlcpy (vcap->driver,"cobalt" ,sizeof (vcap->driver)); -strlcpy (vcap->card,"cobalt" ,sizeof (vcap->card)); +strscpy (vcap->driver,"cobalt" ,sizeof (vcap->driver)); +strscpy (vcap->card,"cobalt" ,sizeof (vcap->card));snprintf (vcap->bus_info,sizeof (vcap->bus_info),"PCIe:%s" ,pci_name (cobalt->pci_dev)); vcap->device_caps =V4L2_CAP_STREAMING |V4L2_CAP_READWRITE ;
@@ -693,15 +693,15 @@ static int cobalt_enum_fmt_vid_cap(struct file *file, void *priv_fh, {switch (f->index) {case 0 : -strlcpy (f->description,"YUV 4:2:2" ,sizeof (f->description)); +strscpy (f->description,"YUV 4:2:2" ,sizeof (f->description)); f->pixelformat =V4L2_PIX_FMT_YUYV ;break ;case 1 : -strlcpy (f->description,"RGB24" ,sizeof (f->description)); +strscpy (f->description,"RGB24" ,sizeof (f->description)); f->pixelformat =V4L2_PIX_FMT_RGB24 ;break ;case 2 : -strlcpy (f->description,"RGB32" ,sizeof (f->description)); +strscpy (f->description,"RGB32" ,sizeof (f->description)); f->pixelformat =V4L2_PIX_FMT_BGR32 ;break ;default :
@@ -898,11 +898,11 @@ static int cobalt_enum_fmt_vid_out(struct file *file, void *priv_fh, {switch (f->index) {case 0 : -strlcpy (f->description,"YUV 4:2:2" ,sizeof (f->description)); +strscpy (f->description,"YUV 4:2:2" ,sizeof (f->description)); f->pixelformat =V4L2_PIX_FMT_YUYV ;break ;case 1 : -strlcpy (f->description,"RGB32" ,sizeof (f->description)); +strscpy (f->description,"RGB32" ,sizeof (f->description)); f->pixelformat =V4L2_PIX_FMT_BGR32 ;break ;default :
drivers/media/pci/cx18/cx18-alsa-main.c +1 -1
@@ -112,7 +112,7 @@ static int snd_cx18_card_set_names(struct snd_cx18_card *cxsc)struct snd_card *sc = cxsc->sc;/* sc->driver is used by alsa-lib's configurator: simple, unique */ -strlcpy (sc->driver,"CX23418" ,sizeof (sc->driver)); +strscpy (sc->driver,"CX23418" ,sizeof (sc->driver));/* sc->shortname is a symlink in /proc/asound: CX18-M -> cardN */ snprintf(sc->shortname, sizeof(sc->shortname), "CX18-%d",
drivers/media/pci/cx18/cx18-alsa-pcm.c +1 -1
@@ -345,7 +345,7 @@ int snd_cx18_pcm_create(struct snd_cx18_card *cxsc) &snd_cx18_pcm_capture_ops); sp->info_flags =0 ; sp->private_data = cxsc; -strlcpy (sp->name, cx->card_name,sizeof (sp->name)); +strscpy (sp->name, cx->card_name,sizeof (sp->name));return 0 ;
drivers/media/pci/cx18/cx18-cards.c +4 -4
@@ -602,8 +602,8 @@ int cx18_get_input(struct cx18 *cx, u16 index, struct v4l2_input *input)if (index >= cx->nof_inputs)return -EINVAL ; input->index = index; -strlcpy (input->name, input_strs[card_input->video_type -1 ], -sizeof (input->name)); +strscpy (input->name, input_strs[card_input->video_type -1 ], +sizeof (input->name)); input->type = (card_input->video_type ==CX18_CARD_INPUT_VID_TUNER ?V4L2_INPUT_TYPE_TUNER :V4L2_INPUT_TYPE_CAMERA ); input->audioset = (1 << cx->nof_audio_inputs) -1 ;
@@ -625,8 +625,8 @@ int cx18_get_audio_input(struct cx18 *cx, u16 index, struct v4l2_audio *audio)memset (audio,0 ,sizeof (*audio));if (index >= cx->nof_audio_inputs)return -EINVAL ; -strlcpy (audio->name, input_strs[aud_input->audio_type -1 ], -sizeof (audio->name)); +strscpy (audio->name, input_strs[aud_input->audio_type -1 ], +sizeof (audio->name)); audio->index = index; audio->capability =V4L2_AUDCAP_STEREO ;return 0 ;
drivers/media/pci/cx18/cx18-driver.c +1 -1
@@ -328,7 +328,7 @@ void cx18_read_eeprom(struct cx18 *cx, struct tveeprom *tv)if (!c)return ; -strlcpy (c->name,"cx18 tveeprom tmp" ,sizeof (c->name)); +strscpy (c->name,"cx18 tveeprom tmp" ,sizeof (c->name)); c->adapter = &cx->i2c_adap[0 ]; c->addr =0xa0 >>1 ;
drivers/media/pci/cx18/cx18-i2c.c +1 -1
@@ -83,7 +83,7 @@ static int cx18_i2c_new_ir(struct cx18 *cx, struct i2c_adapter *adap, u32 hw,unsigned short addr_list[2 ] = { addr,I2C_CLIENT_END };memset (&info,0 ,sizeof (struct i2c_board_info )); -strlcpy (info.type, type,I2C_NAME_SIZE ); +strscpy (info.type, type,I2C_NAME_SIZE );/* Our default information for ir-kbd-i2c.c to use */ switch (hw) {
drivers/media/pci/cx18/cx18-ioctl.c +4 -4
@@ -397,8 +397,8 @@ static int cx18_querycap(struct file *file, void *fh,struct cx18_stream *s =video_drvdata (file);struct cx18 *cx = id->cx; -strlcpy (vcap->driver,CX18_DRIVER_NAME ,sizeof (vcap->driver)); -strlcpy (vcap->card, cx->card_name,sizeof (vcap->card)); +strscpy (vcap->driver,CX18_DRIVER_NAME ,sizeof (vcap->driver)); +strscpy (vcap->card, cx->card_name,sizeof (vcap->card));snprintf (vcap->bus_info,sizeof (vcap->bus_info),"PCI:%s" ,pci_name (cx->pci_dev)); vcap->capabilities = cx->v4l2_cap;/* capabilities */
@@ -632,9 +632,9 @@ static int cx18_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)cx18_call_all (cx, tuner, g_tuner, vt);if (vt->type ==V4L2_TUNER_RADIO ) -strlcpy (vt->name,"cx18 Radio Tuner" ,sizeof (vt->name)); +strscpy (vt->name,"cx18 Radio Tuner" ,sizeof (vt->name));else -strlcpy (vt->name,"cx18 TV Tuner" ,sizeof (vt->name)); +strscpy (vt->name,"cx18 TV Tuner" ,sizeof (vt->name));return 0 ; }
drivers/media/pci/cx23885/cx23885-417.c +3 -3
@@ -1329,8 +1329,8 @@ static int vidioc_querycap(struct file *file, void *priv,struct cx23885_dev *dev =video_drvdata (file);struct cx23885_tsport *tsport = &dev->ts1; -strlcpy (cap->driver, dev->name,sizeof (cap->driver)); -strlcpy (cap->card, cx23885_boards[tsport->dev->board].name, +strscpy (cap->driver, dev->name,sizeof (cap->driver)); +strscpy (cap->card, cx23885_boards[tsport->dev->board].name,sizeof (cap->card));sprintf (cap->bus_info,"PCIe:%s" ,pci_name (dev->pci)); cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
@@ -1349,7 +1349,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,if (f->index !=0 )return -EINVAL ; -strlcpy (f->description,"MPEG" ,sizeof (f->description)); +strscpy (f->description,"MPEG" ,sizeof (f->description)); f->pixelformat =V4L2_PIX_FMT_MPEG ;return 0 ;
drivers/media/pci/cx23885/cx23885-dvb.c +27 -27
216 lines not on this page · raw message
drivers/media/pci/cx23885/cx23885-i2c.c +2 -2
@@ -317,7 +317,7 @@ int cx23885_i2c_register(struct cx23885_i2c *bus) bus->i2c_client = cx23885_i2c_client_template; bus->i2c_adap.dev.parent = &dev->pci->dev; -strlcpy (bus->i2c_adap.name, bus->dev->name, +strscpy (bus->i2c_adap.name, bus->dev->name,sizeof (bus->i2c_adap.name)); bus->i2c_adap.algo_data = bus;
@@ -345,7 +345,7 @@ int cx23885_i2c_register(struct cx23885_i2c *bus) };memset (&info,0 ,sizeof (struct i2c_board_info )); -strlcpy (info.type,"ir_video" ,I2C_NAME_SIZE ); +strscpy (info.type,"ir_video" ,I2C_NAME_SIZE );/* Use quick read command for probe, some IR chips don't * support writes */ i2c_new_probed_device(&bus->i2c_adap, &info, addr_list,
drivers/media/pci/cx23885/cx23885-ioctl.c +2 -2
@@ -31,9 +31,9 @@ int cx23885_g_chip_info(struct file *file, void *fh,if (chip->match.addr ==1 ) {if (dev->v4l_device ==NULL )return -EINVAL ; -strlcpy (chip->name,"cx23417" ,sizeof (chip->name)); +strscpy (chip->name,"cx23417" ,sizeof (chip->name)); }else { -strlcpy (chip->name, dev->v4l2_dev.name,sizeof (chip->name)); +strscpy (chip->name, dev->v4l2_dev.name,sizeof (chip->name)); }return 0 ; }
drivers/media/pci/cx23885/cx23885-video.c +2 -2
@@ -640,7 +640,7 @@ static int vidioc_querycap(struct file *file, void *priv,struct video_device *vdev =video_devdata (file);strcpy (cap->driver,"cx23885" ); -strlcpy (cap->card, cx23885_boards[dev->board].name, +strscpy (cap->card, cx23885_boards[dev->board].name,sizeof (cap->card));sprintf (cap->bus_info,"PCIe:%s" ,pci_name (dev->pci)); cap->device_caps =V4L2_CAP_READWRITE |V4L2_CAP_STREAMING |V4L2_CAP_AUDIO ;
@@ -661,7 +661,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,if (unlikely (f->index >=ARRAY_SIZE (formats)))return -EINVAL ; -strlcpy (f->description, formats[f->index].name, +strscpy (f->description, formats[f->index].name,sizeof (f->description)); f->pixelformat = formats[f->index].fourcc;
drivers/media/pci/cx25821/cx25821-i2c.c +1 -1
@@ -306,7 +306,7 @@ int cx25821_i2c_register(struct cx25821_i2c *bus) bus->i2c_client = cx25821_i2c_client_template; bus->i2c_adap.dev.parent = &dev->pci->dev; -strlcpy (bus->i2c_adap.name, bus->dev->name,sizeof (bus->i2c_adap.name)); +strscpy (bus->i2c_adap.name, bus->dev->name,sizeof (bus->i2c_adap.name)); bus->i2c_adap.algo_data = bus;i2c_set_adapdata (&bus->i2c_adap, &dev->v4l2_dev);
drivers/media/pci/cx25821/cx25821-video.c +2 -2
@@ -322,7 +322,7 @@ static int cx25821_vidioc_enum_fmt_vid_cap(struct file *file, void *priv,if (unlikely (f->index >=ARRAY_SIZE (formats)))return -EINVAL ; -strlcpy (f->description, formats[f->index].name,sizeof (f->description)); +strscpy (f->description, formats[f->index].name,sizeof (f->description)); f->pixelformat = formats[f->index].fourcc;return 0 ;
@@ -442,7 +442,7 @@ static int cx25821_vidioc_querycap(struct file *file, void *priv,const u32 cap_output =V4L2_CAP_VIDEO_OUTPUT |V4L2_CAP_READWRITE ;strcpy (cap->driver,"cx25821" ); -strlcpy (cap->card, cx25821_boards[dev->board].name,sizeof (cap->card)); +strscpy (cap->card, cx25821_boards[dev->board].name,sizeof (cap->card));sprintf (cap->bus_info,"PCIe:%s" ,pci_name (dev->pci));if (chan->id >=VID_CHANNEL_NUM ) cap->device_caps = cap_output;
drivers/media/pci/cx88/cx88-blackbird.c +1 -1
@@ -814,7 +814,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,if (f->index !=0 )return -EINVAL ; -strlcpy (f->description,"MPEG" ,sizeof (f->description)); +strscpy (f->description,"MPEG" ,sizeof (f->description)); f->pixelformat =V4L2_PIX_FMT_MPEG ; f->flags =V4L2_FMT_FLAG_COMPRESSED ;return 0 ;
drivers/media/pci/cx88/cx88-i2c.c +2 -2
@@ -140,14 +140,14 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci) core->i2c_algo = cx8800_i2c_algo_template; core->i2c_adap.dev.parent = &pci->dev; -strlcpy (core->i2c_adap.name, core->name,sizeof (core->i2c_adap.name)); +strscpy (core->i2c_adap.name, core->name,sizeof (core->i2c_adap.name)); core->i2c_adap.owner =THIS_MODULE ; core->i2c_algo.udelay = i2c_udelay; core->i2c_algo.data = core;i2c_set_adapdata (&core->i2c_adap, &core->v4l2_dev); core->i2c_adap.algo_data = &core->i2c_algo; core->i2c_client.adapter = &core->i2c_adap; -strlcpy (core->i2c_client.name,"cx88xx internal" ,I2C_NAME_SIZE ); +strscpy (core->i2c_client.name,"cx88xx internal" ,I2C_NAME_SIZE );cx8800_bit_setscl (core,1 );cx8800_bit_setsda (core,1 );
drivers/media/pci/cx88/cx88-input.c +2 -2
@@ -610,7 +610,7 @@ void cx88_i2c_init_ir(struct cx88_core *core)return ;memset (&info,0 ,sizeof (struct i2c_board_info )); -strlcpy (info.type,"ir_video" ,I2C_NAME_SIZE ); +strscpy (info.type,"ir_video" ,I2C_NAME_SIZE );switch (core->boardnr) {case CX88_BOARD_LEADTEK_PVR2000 :
@@ -635,7 +635,7 @@ void cx88_i2c_init_ir(struct cx88_core *core)if (*addrp ==0x71 ) {/* Hauppauge Z8F0811 */ -strlcpy (info.type,"ir_z8f0811_haup" ,I2C_NAME_SIZE ); +strscpy (info.type,"ir_z8f0811_haup" ,I2C_NAME_SIZE ); core->init_data.name = core->board.name; core->init_data.ir_codes =RC_MAP_HAUPPAUGE ; core->init_data.type = RC_PROTO_BIT_RC5 |
drivers/media/pci/cx88/cx88-video.c +2 -2
@@ -811,7 +811,7 @@ int cx88_querycap(struct file *file, struct cx88_core *core, {struct video_device *vdev =video_devdata (file); -strlcpy (cap->card, core->board.name,sizeof (cap->card)); +strscpy (cap->card, core->board.name,sizeof (cap->card)); cap->device_caps =V4L2_CAP_READWRITE |V4L2_CAP_STREAMING ;if (core->board.tuner_type !=UNSET ) cap->device_caps |=V4L2_CAP_TUNER ;
@@ -853,7 +853,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,if (unlikely (f->index >=ARRAY_SIZE (formats)))return -EINVAL ; -strlcpy (f->description, formats[f->index].name,sizeof (f->description)); +strscpy (f->description, formats[f->index].name,sizeof (f->description)); f->pixelformat = formats[f->index].fourcc;return 0 ;
drivers/media/pci/cx88/cx88-vp3054-i2c.c +1 -1
@@ -114,7 +114,7 @@ int vp3054_i2c_probe(struct cx8802_dev *dev) vp3054_i2c->algo = vp3054_i2c_algo_template; vp3054_i2c->adap.dev.parent = &dev->pci->dev; -strlcpy (vp3054_i2c->adap.name, core->name, +strscpy (vp3054_i2c->adap.name, core->name,sizeof (vp3054_i2c->adap.name)); vp3054_i2c->adap.owner =THIS_MODULE ; vp3054_i2c->algo.data = dev;
drivers/media/pci/dt3155/dt3155.c +1 -1
@@ -378,7 +378,7 @@ static int dt3155_enum_input(struct file *filp, void *p,snprintf (input->name,sizeof (input->name),"VID%d" , input->index); else - strlcpy(input->name, "J2/VID0", sizeof(input->name)); + strscpy(input->name, "J2/VID0", sizeof(input->name)); input->type =V4L2_INPUT_TYPE_CAMERA ; input->std =V4L2_STD_ALL ; input->status =0 ;
drivers/media/pci/intel/ipu3/ipu3-cio2.c +4 -4
@@ -1064,8 +1064,8 @@ static int cio2_v4l2_querycap(struct file *file, void *fh, {struct cio2_device *cio2 =video_drvdata (file); -strlcpy (cap->driver,CIO2_NAME ,sizeof (cap->driver)); -strlcpy (cap->card,CIO2_DEVICE_NAME ,sizeof (cap->card)); +strscpy (cap->driver,CIO2_NAME ,sizeof (cap->driver)); +strscpy (cap->card,CIO2_DEVICE_NAME ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"PCI:%s" ,pci_name (cio2->pci_dev));
@@ -1143,7 +1143,7 @@ cio2_video_enum_input(struct file *file, void *fh, struct v4l2_input *input)if (input->index >0 )return -EINVAL ; -strlcpy (input->name,"camera" ,sizeof (input->name)); +strscpy (input->name,"camera" ,sizeof (input->name)); input->type =V4L2_INPUT_TYPE_CAMERA ;return 0 ;
@@ -1783,7 +1783,7 @@ static int cio2_pci_probe(struct pci_dev *pci_dev,mutex_init (&cio2->lock); cio2->media_dev.dev = &cio2->pci_dev->dev; -strlcpy (cio2->media_dev.model,CIO2_DEVICE_NAME , +strscpy (cio2->media_dev.model,CIO2_DEVICE_NAME ,sizeof (cio2->media_dev.model));snprintf (cio2->media_dev.bus_info,sizeof (cio2->media_dev.bus_info),"PCI:%s" ,pci_name (cio2->pci_dev));
drivers/media/pci/ivtv/ivtv-alsa-main.c +1 -1
@@ -109,7 +109,7 @@ static int snd_ivtv_card_set_names(struct snd_ivtv_card *itvsc)struct snd_card *sc = itvsc->sc;/* sc->driver is used by alsa-lib's configurator: simple, unique */ -strlcpy (sc->driver,"CX2341[56]" ,sizeof (sc->driver)); +strscpy (sc->driver,"CX2341[56]" ,sizeof (sc->driver));/* sc->shortname is a symlink in /proc/asound: IVTV-M -> cardN */ snprintf(sc->shortname, sizeof(sc->shortname), "IVTV-%d",
drivers/media/pci/ivtv/ivtv-alsa-pcm.c +1 -1
@@ -350,7 +350,7 @@ int snd_ivtv_pcm_create(struct snd_ivtv_card *itvsc) &snd_ivtv_pcm_capture_ops); sp->info_flags =0 ; sp->private_data = itvsc; -strlcpy (sp->name, itv->card_name,sizeof (sp->name)); +strscpy (sp->name, itv->card_name,sizeof (sp->name));return 0 ;
drivers/media/pci/ivtv/ivtv-cards.c +6 -6
@@ -1317,8 +1317,8 @@ int ivtv_get_input(struct ivtv *itv, u16 index, struct v4l2_input *input)if (index >= itv->nof_inputs)return -EINVAL ; input->index = index; -strlcpy (input->name, input_strs[card_input->video_type -1 ], -sizeof (input->name)); +strscpy (input->name, input_strs[card_input->video_type -1 ], +sizeof (input->name)); input->type = (card_input->video_type ==IVTV_CARD_INPUT_VID_TUNER ?V4L2_INPUT_TYPE_TUNER :V4L2_INPUT_TYPE_CAMERA ); input->audioset = (1 << itv->nof_audio_inputs) -1 ;
@@ -1334,7 +1334,7 @@ int ivtv_get_output(struct ivtv *itv, u16 index, struct v4l2_output *output)if (index >= itv->card->nof_outputs)return -EINVAL ; output->index = index; -strlcpy (output->name, card_output->name,sizeof (output->name)); +strscpy (output->name, card_output->name,sizeof (output->name)); output->type =V4L2_OUTPUT_TYPE_ANALOG ; output->audioset =1 ; output->std =V4L2_STD_ALL ;
@@ -1353,8 +1353,8 @@ int ivtv_get_audio_input(struct ivtv *itv, u16 index, struct v4l2_audio *audio)memset (audio,0 ,sizeof (*audio));if (index >= itv->nof_audio_inputs)return -EINVAL ; -strlcpy (audio->name, input_strs[aud_input->audio_type -1 ], -sizeof (audio->name)); +strscpy (audio->name, input_strs[aud_input->audio_type -1 ], +sizeof (audio->name)); audio->index = index; audio->capability =V4L2_AUDCAP_STEREO ;return 0 ;
@@ -1365,6 +1365,6 @@ int ivtv_get_audio_output(struct ivtv *itv, u16 index, struct v4l2_audioout *audmemset (aud_output,0 ,sizeof (*aud_output));if (itv->card->video_outputs ==NULL || index !=0 )return -EINVAL ; -strlcpy (aud_output->name,"A/V Audio Out" ,sizeof (aud_output->name)); +strscpy (aud_output->name,"A/V Audio Out" ,sizeof (aud_output->name));return 0 ; }
drivers/media/pci/ivtv/ivtv-i2c.c +2 -2
@@ -218,7 +218,7 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr)memset (&info,0 ,sizeof (struct i2c_board_info )); info.platform_data = init_data; -strlcpy (info.type, type,I2C_NAME_SIZE ); +strscpy (info.type, type,I2C_NAME_SIZE );return i2c_new_probed_device (adap, &info, addr_list,NULL ) ==NULL ?-1 :0 ;
@@ -246,7 +246,7 @@ struct i2c_client *ivtv_i2c_new_ir_legacy(struct ivtv *itv) };memset (&info,0 ,sizeof (struct i2c_board_info )); -strlcpy (info.type,"ir_video" ,I2C_NAME_SIZE ); +strscpy (info.type,"ir_video" ,I2C_NAME_SIZE );return i2c_new_probed_device (&itv->i2c_adap, &info, addr_list,NULL ); }
drivers/media/pci/ivtv/ivtv-ioctl.c +4 -4
@@ -747,8 +747,8 @@ static int ivtv_querycap(struct file *file, void *fh, struct v4l2_capability *vcstruct ivtv *itv = id->itv;struct ivtv_stream *s = &itv->streams[id->type]; -strlcpy (vcap->driver,IVTV_DRIVER_NAME ,sizeof (vcap->driver)); -strlcpy (vcap->card, itv->card_name,sizeof (vcap->card)); +strscpy (vcap->driver,IVTV_DRIVER_NAME ,sizeof (vcap->driver)); +strscpy (vcap->card, itv->card_name,sizeof (vcap->card));snprintf (vcap->bus_info,sizeof (vcap->bus_info),"PCI:%s" ,pci_name (itv->pdev)); vcap->capabilities = itv->v4l2_cap |V4L2_CAP_DEVICE_CAPS ; vcap->device_caps = s->caps;
@@ -1227,9 +1227,9 @@ static int ivtv_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)ivtv_call_all (itv, tuner, g_tuner, vt);if (vt->type ==V4L2_TUNER_RADIO ) -strlcpy (vt->name,"ivtv Radio Tuner" ,sizeof (vt->name)); +strscpy (vt->name,"ivtv Radio Tuner" ,sizeof (vt->name));else -strlcpy (vt->name,"ivtv TV Tuner" ,sizeof (vt->name)); +strscpy (vt->name,"ivtv TV Tuner" ,sizeof (vt->name));return 0 ; }
drivers/media/pci/ivtv/ivtvfb.c +1 -1
@@ -624,7 +624,7 @@ static int ivtvfb_get_fix(struct ivtv *itv, struct fb_fix_screeninfo *fix)IVTVFB_DEBUG_INFO ("ivtvfb_get_fix\n" );memset (fix,0 ,sizeof (struct fb_fix_screeninfo )); -strlcpy (fix->id,"cx23415 TV out" ,sizeof (fix->id)); +strscpy (fix->id,"cx23415 TV out" ,sizeof (fix->id)); fix->smem_start = oi->video_pbase; fix->smem_len = oi->video_buffer_size; fix->type =FB_TYPE_PACKED_PIXELS ;
drivers/media/pci/pt3/pt3.c +1 -1
@@ -765,7 +765,7 @@ static int pt3_probe(struct pci_dev *pdev, const struct pci_device_id *ent) i2c->algo = &pt3_i2c_algo; i2c->algo_data =NULL ; i2c->dev.parent = &pdev->dev; -strlcpy (i2c->name,DRV_NAME ,sizeof (i2c->name)); +strscpy (i2c->name,DRV_NAME ,sizeof (i2c->name));i2c_set_adapdata (i2c, pt3); ret =i2c_add_adapter (i2c);if (ret <0 )
drivers/media/pci/saa7134/saa7134-empress.c +1 -1
@@ -100,7 +100,7 @@ static int empress_enum_fmt_vid_cap(struct file *file, void *priv,if (f->index !=0 )return -EINVAL ; -strlcpy (f->description,"MPEG TS" ,sizeof (f->description)); +strscpy (f->description,"MPEG TS" ,sizeof (f->description)); f->pixelformat =V4L2_PIX_FMT_MPEG ; f->flags =V4L2_FMT_FLAG_COMPRESSED ;return 0 ;
drivers/media/pci/saa7134/saa7134-go7007.c +1 -1
@@ -435,7 +435,7 @@ static int saa7134_go7007_init(struct saa7134_dev *dev) go->board_id =GO7007_BOARDID_PCI_VOYAGER ;snprintf (go->bus_info,sizeof (go->bus_info),"PCI:%s" ,pci_name (dev->pci)); -strlcpy (go->name, saa7134_boards[dev->board].name,sizeof (go->name)); +strscpy (go->name, saa7134_boards[dev->board].name,sizeof (go->name)); go->hpi_ops = &saa7134_go7007_hpi_ops; go->hpi_context = saa; saa->dev = dev;
drivers/media/pci/saa7134/saa7134-input.c +1 -1
@@ -953,7 +953,7 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)memset (&info,0 ,sizeof (struct i2c_board_info ));memset (&dev->init_data,0 ,sizeof (dev->init_data)); -strlcpy (info.type,"ir_video" ,I2C_NAME_SIZE ); +strscpy (info.type,"ir_video" ,I2C_NAME_SIZE );switch (dev->board) {case SAA7134_BOARD_PINNACLE_PCTV_110i:
drivers/media/pci/saa7134/saa7134-video.c +3 -3
@@ -1503,7 +1503,7 @@ int saa7134_querycap(struct file *file, void *priv,unsigned int tuner_type = dev->tuner_type;strcpy (cap->driver,"saa7134" ); -strlcpy (cap->card, saa7134_boards[dev->board].name, +strscpy (cap->card, saa7134_boards[dev->board].name,sizeof (cap->card));sprintf (cap->bus_info,"PCI:%s" ,pci_name (dev->pci));
@@ -1819,7 +1819,7 @@ static int saa7134_enum_fmt_vid_cap(struct file *file, void *priv,if (f->index >=FORMATS )return -EINVAL ; -strlcpy (f->description, formats[f->index].name, +strscpy (f->description, formats[f->index].name,sizeof (f->description)); f->pixelformat = formats[f->index].fourcc;
@@ -1838,7 +1838,7 @@ static int saa7134_enum_fmt_vid_overlay(struct file *file, void *priv,if ((f->index >=FORMATS ) || formats[f->index].planar)return -EINVAL ; -strlcpy (f->description, formats[f->index].name, +strscpy (f->description, formats[f->index].name,sizeof (f->description)); f->pixelformat = formats[f->index].fourcc;
drivers/media/pci/saa7146/mxb.c +1 -1
@@ -553,7 +553,7 @@ static int vidioc_g_tuner(struct file *file, void *fh, struct v4l2_tuner *t)DEB_EE ("VIDIOC_G_TUNER: %d\n" , t->index);memset (t,0 ,sizeof (*t)); -strlcpy (t->name,"TV Tuner" ,sizeof (t->name)); +strscpy (t->name,"TV Tuner" ,sizeof (t->name)); t->type =V4L2_TUNER_ANALOG_TV ; t->capability =V4L2_TUNER_CAP_NORM |V4L2_TUNER_CAP_STEREO |V4L2_TUNER_CAP_LANG1 |V4L2_TUNER_CAP_LANG2 |V4L2_TUNER_CAP_SAP ;
drivers/media/pci/saa7164/saa7164-dvb.c +5 -5
@@ -120,7 +120,7 @@ static int si2157_attach(struct saa7164_port *port, struct i2c_adapter *adapter,memset (&bi,0 ,sizeof (bi)); -strlcpy (bi.type,"si2157" ,I2C_NAME_SIZE ); +strscpy (bi.type,"si2157" ,I2C_NAME_SIZE ); bi.platform_data = cfg; bi.addr = addr8bit >>1 ;
@@ -643,7 +643,7 @@ int saa7164_dvb_register(struct saa7164_port *port) si2168_config.fe = &port->dvb.frontend; si2168_config.ts_mode =SI2168_TS_SERIAL ;memset (&info,0 ,sizeof (struct i2c_board_info )); -strlcpy (info.type,"si2168" ,I2C_NAME_SIZE ); +strscpy (info.type,"si2168" ,I2C_NAME_SIZE ); info.addr =0xc8 >>1 ; info.platform_data = &si2168_config;request_module (info.type);
@@ -663,7 +663,7 @@ int saa7164_dvb_register(struct saa7164_port *port) si2157_config.if_port =1 ; si2157_config.fe = port->dvb.frontend;memset (&info,0 ,sizeof (struct i2c_board_info )); -strlcpy (info.type,"si2157" ,I2C_NAME_SIZE ); +strscpy (info.type,"si2157" ,I2C_NAME_SIZE ); info.addr =0xc0 >>1 ; info.platform_data = &si2157_config;request_module (info.type);
@@ -688,7 +688,7 @@ int saa7164_dvb_register(struct saa7164_port *port) si2168_config.fe = &port->dvb.frontend; si2168_config.ts_mode =SI2168_TS_SERIAL ;memset (&info,0 ,sizeof (struct i2c_board_info )); -strlcpy (info.type,"si2168" ,I2C_NAME_SIZE ); +strscpy (info.type,"si2168" ,I2C_NAME_SIZE ); info.addr =0xcc >>1 ; info.platform_data = &si2168_config;request_module (info.type);
@@ -708,7 +708,7 @@ int saa7164_dvb_register(struct saa7164_port *port) si2157_config.fe = port->dvb.frontend; si2157_config.if_port =1 ;memset (&info,0 ,sizeof (struct i2c_board_info )); -strlcpy (info.type,"si2157" ,I2C_NAME_SIZE ); +strscpy (info.type,"si2157" ,I2C_NAME_SIZE ); info.addr =0xc0 >>1 ; info.platform_data = &si2157_config;request_module (info.type);
drivers/media/pci/saa7164/saa7164-encoder.c +2 -2
@@ -498,7 +498,7 @@ static int vidioc_querycap(struct file *file, void *priv,struct saa7164_dev *dev = port->dev;strcpy (cap->driver, dev->name); -strlcpy (cap->card, saa7164_boards[dev->board].name, +strscpy (cap->card, saa7164_boards[dev->board].name,sizeof (cap->card));sprintf (cap->bus_info,"PCI:%s" ,pci_name (dev->pci));
@@ -520,7 +520,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,if (f->index !=0 )return -EINVAL ; -strlcpy (f->description,"MPEG" ,sizeof (f->description)); +strscpy (f->description,"MPEG" ,sizeof (f->description)); f->pixelformat =V4L2_PIX_FMT_MPEG ;return 0 ;
drivers/media/pci/saa7164/saa7164-i2c.c +1 -1
@@ -99,7 +99,7 @@ int saa7164_i2c_register(struct saa7164_i2c *bus) bus->i2c_adap.dev.parent = &dev->pci->dev; -strlcpy (bus->i2c_adap.name, bus->dev->name, +strscpy (bus->i2c_adap.name, bus->dev->name,sizeof (bus->i2c_adap.name)); bus->i2c_adap.algo_data = bus;
drivers/media/pci/saa7164/saa7164-vbi.c +1 -1
@@ -209,7 +209,7 @@ static int vidioc_querycap(struct file *file, void *priv,struct saa7164_dev *dev = port->dev;strcpy (cap->driver, dev->name); -strlcpy (cap->card, saa7164_boards[dev->board].name, +strscpy (cap->card, saa7164_boards[dev->board].name,sizeof (cap->card));sprintf (cap->bus_info,"PCI:%s" ,pci_name (dev->pci));
drivers/media/pci/smipcie/smipcie-main.c +4 -4
@@ -549,7 +549,7 @@ static int smi_dvbsky_m88ds3103_fe_attach(struct smi_port *port) }/* attach tuner */ ts2020_config.fe = port->fe; -strlcpy (tuner_info.type,"ts2020" ,I2C_NAME_SIZE ); +strscpy (tuner_info.type,"ts2020" ,I2C_NAME_SIZE ); tuner_info.addr =0x60 ; tuner_info.platform_data = &ts2020_config; tuner_client =smi_add_i2c_client (tuner_i2c_adapter, &tuner_info);
@@ -605,7 +605,7 @@ static int smi_dvbsky_m88rs6000_fe_attach(struct smi_port *port) }/* attach tuner */ m88rs6000t_config.fe = port->fe; -strlcpy (tuner_info.type,"m88rs6000t" ,I2C_NAME_SIZE ); +strscpy (tuner_info.type,"m88rs6000t" ,I2C_NAME_SIZE ); tuner_info.addr =0x21 ; tuner_info.platform_data = &m88rs6000t_config; tuner_client =smi_add_i2c_client (tuner_i2c_adapter, &tuner_info);
@@ -647,7 +647,7 @@ static int smi_dvbsky_sit2_fe_attach(struct smi_port *port) si2168_config.ts_mode =SI2168_TS_PARALLEL ;memset (&client_info,0 ,sizeof (struct i2c_board_info )); -strlcpy (client_info.type,"si2168" ,I2C_NAME_SIZE ); +strscpy (client_info.type,"si2168" ,I2C_NAME_SIZE ); client_info.addr =0x64 ; client_info.platform_data = &si2168_config;
@@ -664,7 +664,7 @@ static int smi_dvbsky_sit2_fe_attach(struct smi_port *port) si2157_config.if_port =1 ;memset (&client_info,0 ,sizeof (struct i2c_board_info )); -strlcpy (client_info.type,"si2157" ,I2C_NAME_SIZE ); +strscpy (client_info.type,"si2157" ,I2C_NAME_SIZE ); client_info.addr =0x60 ; client_info.platform_data = &si2157_config;
drivers/media/pci/solo6x10/solo6x10-v4l2.c +1 -1
@@ -470,7 +470,7 @@ static int solo_enum_fmt_cap(struct file *file, void *priv,return -EINVAL ; f->pixelformat =V4L2_PIX_FMT_UYVY ; -strlcpy (f->description,"UYUV 4:2:2 Packed" ,sizeof (f->description)); +strscpy (f->description,"UYUV 4:2:2 Packed" ,sizeof (f->description));return 0 ; }
drivers/media/pci/ttpci/av7110.c +2 -1
@@ -2482,7 +2482,8 @@ static int av7110_attach(struct saa7146_dev* dev,get recognized before the main driver is fully loaded */ saa7146_write (dev,GPIO_CTRL ,0x500000 ); -strlcpy (av7110->i2c_adap.name, pci_ext->ext_priv,sizeof (av7110->i2c_adap.name)); +strscpy (av7110->i2c_adap.name, pci_ext->ext_priv, +sizeof (av7110->i2c_adap.name));saa7146_i2c_adapter_prepare (dev, &av7110->i2c_adap,SAA7146_I2C_BUS_BIT_RATE_120 );/* 275 kHz */
drivers/media/pci/ttpci/budget-core.c +2 -1
@@ -504,7 +504,8 @@ int ttpci_budget_init(struct budget *budget, struct saa7146_dev *dev,if (bi->type !=BUDGET_FS_ACTIVY )saa7146_write (dev,GPIO_CTRL ,0x500000 );/* GPIO 3 = 1 */ -strlcpy (budget->i2c_adap.name, budget->card->name,sizeof (budget->i2c_adap.name)); +strscpy (budget->i2c_adap.name, budget->card->name, +sizeof (budget->i2c_adap.name));saa7146_i2c_adapter_prepare (dev, &budget->i2c_adap,SAA7146_I2C_BUS_BIT_RATE_120 );strcpy (budget->i2c_adap.name, budget->card->name);
drivers/media/pci/tw68/tw68-video.c +2 -2
@@ -735,7 +735,7 @@ static int tw68_querycap(struct file *file, void *priv,struct tw68_dev *dev =video_drvdata (file);strcpy (cap->driver,"tw68" ); -strlcpy (cap->card,"Techwell Capture Card" , +strscpy (cap->card,"Techwell Capture Card" ,sizeof (cap->card));sprintf (cap->bus_info,"PCI:%s" ,pci_name (dev->pci)); cap->device_caps =
@@ -789,7 +789,7 @@ static int tw68_enum_fmt_vid_cap(struct file *file, void *priv,if (f->index >=FORMATS )return -EINVAL ; -strlcpy (f->description, formats[f->index].name, +strscpy (f->description, formats[f->index].name,sizeof (f->description)); f->pixelformat = formats[f->index].fourcc;
drivers/media/pci/tw686x/tw686x-audio.c +4 -4
@@ -295,7 +295,7 @@ static int tw686x_snd_pcm_init(struct tw686x_dev *dev)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &tw686x_pcm_ops);snd_pcm_chip (pcm) = dev; pcm->info_flags =0 ; -strlcpy (pcm->name,"tw686x PCM" ,sizeof (pcm->name)); +strscpy (pcm->name,"tw686x PCM" ,sizeof (pcm->name));for (i =0 , ss = pcm->streams[SNDRV_PCM_STREAM_CAPTURE ].substream; ss; ss = ss->next, i++)
@@ -390,9 +390,9 @@ int tw686x_audio_init(struct tw686x_dev *dev)return err; dev->snd_card = card; -strlcpy (card->driver,"tw686x" ,sizeof (card->driver)); -strlcpy (card->shortname,"tw686x" ,sizeof (card->shortname)); -strlcpy (card->longname,pci_name (pci_dev),sizeof (card->longname)); +strscpy (card->driver,"tw686x" ,sizeof (card->driver)); +strscpy (card->shortname,"tw686x" ,sizeof (card->shortname)); +strscpy (card->longname,pci_name (pci_dev),sizeof (card->longname));snd_card_set_dev (card, &pci_dev->dev);for (ch =0 ; ch <max_channels (dev); ch++) {
drivers/media/pci/tw686x/tw686x-video.c +2 -2
@@ -765,8 +765,8 @@ static int tw686x_querycap(struct file *file, void *priv,struct tw686x_video_channel *vc =video_drvdata (file);struct tw686x_dev *dev = vc->dev; -strlcpy (cap->driver,"tw686x" ,sizeof (cap->driver)); -strlcpy (cap->card, dev->name,sizeof (cap->card)); +strscpy (cap->driver,"tw686x" ,sizeof (cap->driver)); +strscpy (cap->card, dev->name,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"PCI:%s" ,pci_name (dev->pci_dev)); cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
drivers/media/platform/am437x/am437x-vpfe.c +3 -3
@@ -1408,8 +1408,8 @@ static int vpfe_querycap(struct file *file, void *priv,vpfe_dbg (2 , vpfe,"vpfe_querycap\n" ); -strlcpy (cap->driver,VPFE_MODULE_NAME ,sizeof (cap->driver)); -strlcpy (cap->card,"TI AM437x VPFE" ,sizeof (cap->card)); +strscpy (cap->driver,VPFE_MODULE_NAME ,sizeof (cap->driver)); +strscpy (cap->card,"TI AM437x VPFE" ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" , vpfe->v4l2_dev.name); cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
@@ -2386,7 +2386,7 @@ static int vpfe_probe_complete(struct vpfe_device *vpfe)INIT_LIST_HEAD (&vpfe->dma_queue); vdev = &vpfe->video_dev; -strlcpy (vdev->name,VPFE_MODULE_NAME ,sizeof (vdev->name)); +strscpy (vdev->name,VPFE_MODULE_NAME ,sizeof (vdev->name)); vdev->release = video_device_release_empty; vdev->fops = &vpfe_fops; vdev->ioctl_ops = &vpfe_ioctl_ops;
drivers/media/platform/atmel/atmel-isc.c +1 -1
@@ -1951,7 +1951,7 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier)INIT_WORK (&isc->awb_work, isc_awb_work);/* Register video device */ -strlcpy (vdev->name,ATMEL_ISC_NAME ,sizeof (vdev->name)); +strscpy (vdev->name,ATMEL_ISC_NAME ,sizeof (vdev->name)); vdev->release = video_device_release_empty; vdev->fops = &isc_fops; vdev->ioctl_ops = &isc_ioctl_ops;
drivers/media/platform/atmel/atmel-isi.c +5 -5
@@ -655,9 +655,9 @@ static int isi_enum_fmt_vid_cap(struct file *file, void *priv,static int isi_querycap (struct file *file,void *priv,struct v4l2_capability *cap) { -strlcpy (cap->driver,"atmel-isi" ,sizeof (cap->driver)); -strlcpy (cap->card,"Atmel Image Sensor Interface" ,sizeof (cap->card)); -strlcpy (cap->bus_info,"platform:isi" ,sizeof (cap->bus_info)); +strscpy (cap->driver,"atmel-isi" ,sizeof (cap->driver)); +strscpy (cap->card,"Atmel Image Sensor Interface" ,sizeof (cap->card)); +strscpy (cap->bus_info,"platform:isi" ,sizeof (cap->bus_info));return 0 ; }
@@ -668,7 +668,7 @@ static int isi_enum_input(struct file *file, void *priv,return -EINVAL ; i->type =V4L2_INPUT_TYPE_CAMERA ; -strlcpy (i->name,"Camera" ,sizeof (i->name)); +strscpy (i->name,"Camera" ,sizeof (i->name));return 0 ; }
@@ -1202,7 +1202,7 @@ static int atmel_isi_probe(struct platform_device *pdev) isi->vdev->fops = &isi_fops; isi->vdev->v4l2_dev = &isi->v4l2_dev; isi->vdev->queue = &isi->queue; -strlcpy (isi->vdev->name,KBUILD_MODNAME ,sizeof (isi->vdev->name)); +strscpy (isi->vdev->name,KBUILD_MODNAME ,sizeof (isi->vdev->name)); isi->vdev->release = video_device_release; isi->vdev->ioctl_ops = &isi_ioctl_ops; isi->vdev->lock = &isi->lock;
drivers/media/platform/coda/coda-common.c +4 -4
@@ -390,10 +390,10 @@ static int coda_querycap(struct file *file, void *priv, {struct coda_ctx *ctx =fh_to_ctx (priv); -strlcpy (cap->driver,CODA_NAME ,sizeof (cap->driver)); -strlcpy (cap->card,coda_product_name (ctx->dev->devtype->product), +strscpy (cap->driver,CODA_NAME ,sizeof (cap->driver)); +strscpy (cap->card,coda_product_name (ctx->dev->devtype->product),sizeof (cap->card)); -strlcpy (cap->bus_info,"platform:" CODA_NAME ,sizeof (cap->bus_info)); +strscpy (cap->bus_info,"platform:" CODA_NAME ,sizeof (cap->bus_info)); cap->device_caps =V4L2_CAP_VIDEO_M2M |V4L2_CAP_STREAMING ; cap->capabilities = cap->device_caps |V4L2_CAP_DEVICE_CAPS ;
@@ -2408,7 +2408,7 @@ static int coda_register_device(struct coda_dev *dev, int i)if (i >= dev->devtype->num_vdevs)return -EINVAL ; -strlcpy (vfd->name, dev->devtype->vdevs[i]->name,sizeof (vfd->name)); +strscpy (vfd->name, dev->devtype->vdevs[i]->name,sizeof (vfd->name)); vfd->fops = &coda_fops; vfd->ioctl_ops = &coda_ioctl_ops; vfd->release = video_device_release_empty,
drivers/media/platform/davinci/vpbe_display.c +1 -1
@@ -647,7 +647,7 @@ static int vpbe_display_querycap(struct file *file, void *priv, dev_name(vpbe_dev->pdev));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" ,dev_name (vpbe_dev->pdev)); -strlcpy (cap->card, vpbe_dev->cfg->module_name,sizeof (cap->card)); +strscpy (cap->card, vpbe_dev->cfg->module_name,sizeof (cap->card));return 0 ; }
drivers/media/platform/davinci/vpfe_capture.c +3 -3
@@ -889,9 +889,9 @@ static int vpfe_querycap(struct file *file, void *priv, cap->device_caps =V4L2_CAP_VIDEO_CAPTURE |V4L2_CAP_STREAMING ; cap->capabilities = cap->device_caps |V4L2_CAP_DEVICE_CAPS ; -strlcpy (cap->driver,CAPTURE_DRV_NAME ,sizeof (cap->driver)); -strlcpy (cap->bus_info,"VPFE" ,sizeof (cap->bus_info)); -strlcpy (cap->card, vpfe_dev->cfg->card_name,sizeof (cap->card)); +strscpy (cap->driver,CAPTURE_DRV_NAME ,sizeof (cap->driver)); +strscpy (cap->bus_info,"VPFE" ,sizeof (cap->bus_info)); +strscpy (cap->card, vpfe_dev->cfg->card_name,sizeof (cap->card));return 0 ; }
drivers/media/platform/davinci/vpif_capture.c +3 -3
@@ -1094,10 +1094,10 @@ static int vpif_querycap(struct file *file, void *priv, cap->device_caps =V4L2_CAP_VIDEO_CAPTURE |V4L2_CAP_STREAMING ; cap->capabilities = cap->device_caps |V4L2_CAP_DEVICE_CAPS ; -strlcpy (cap->driver,VPIF_DRIVER_NAME ,sizeof (cap->driver)); +strscpy (cap->driver,VPIF_DRIVER_NAME ,sizeof (cap->driver));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" ,dev_name (vpif_dev)); -strlcpy (cap->card, config->card_name,sizeof (cap->card)); +strscpy (cap->card, config->card_name,sizeof (cap->card));return 0 ; }
@@ -1463,7 +1463,7 @@ static int vpif_probe_complete(void)/* Initialize the video_device structure */ vdev = &ch->video_dev; -strlcpy (vdev->name,VPIF_DRIVER_NAME ,sizeof (vdev->name)); +strscpy (vdev->name,VPIF_DRIVER_NAME ,sizeof (vdev->name)); vdev->release = video_device_release_empty; vdev->fops = &vpif_fops; vdev->ioctl_ops = &vpif_ioctl_ops;
drivers/media/platform/davinci/vpif_display.c +3 -3
@@ -586,10 +586,10 @@ static int vpif_querycap(struct file *file, void *priv, cap->device_caps =V4L2_CAP_VIDEO_OUTPUT |V4L2_CAP_STREAMING ; cap->capabilities = cap->device_caps |V4L2_CAP_DEVICE_CAPS ; -strlcpy (cap->driver,VPIF_DRIVER_NAME ,sizeof (cap->driver)); +strscpy (cap->driver,VPIF_DRIVER_NAME ,sizeof (cap->driver));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" ,dev_name (vpif_dev)); -strlcpy (cap->card, config->card_name,sizeof (cap->card)); +strscpy (cap->card, config->card_name,sizeof (cap->card));return 0 ; }
@@ -1209,7 +1209,7 @@ static int vpif_probe_complete(void)/* Initialize the video_device structure */ vdev = &ch->video_dev; -strlcpy (vdev->name,VPIF_DRIVER_NAME ,sizeof (vdev->name)); +strscpy (vdev->name,VPIF_DRIVER_NAME ,sizeof (vdev->name)); vdev->release = video_device_release_empty; vdev->fops = &vpif_fops; vdev->ioctl_ops = &vpif_ioctl_ops;
drivers/media/platform/exynos-gsc/gsc-core.c +1 -1
@@ -339,7 +339,7 @@ int gsc_enum_fmt_mplane(struct v4l2_fmtdesc *f)if (!fmt)return -EINVAL ; -strlcpy (f->description, fmt->name,sizeof (f->description)); +strscpy (f->description, fmt->name,sizeof (f->description)); f->pixelformat = fmt->pixelformat;return 0 ;
drivers/media/platform/exynos-gsc/gsc-m2m.c +2 -2
@@ -294,8 +294,8 @@ static int gsc_m2m_querycap(struct file *file, void *fh,struct gsc_ctx *ctx =fh_to_ctx (fh);struct gsc_dev *gsc = ctx->gsc_dev; -strlcpy (cap->driver,GSC_MODULE_NAME ,sizeof (cap->driver)); -strlcpy (cap->card,GSC_MODULE_NAME " gscaler" ,sizeof (cap->card)); +strscpy (cap->driver,GSC_MODULE_NAME ,sizeof (cap->driver)); +strscpy (cap->card,GSC_MODULE_NAME " gscaler" ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" ,dev_name (&gsc->pdev->dev)); cap->device_caps =V4L2_CAP_STREAMING |V4L2_CAP_VIDEO_M2M_MPLANE ;
drivers/media/platform/exynos4-is/common.c +2 -2
@@ -40,8 +40,8 @@ EXPORT_SYMBOL(fimc_find_remote_sensor);void __fimc_vidioc_querycap (struct device *dev,struct v4l2_capability *cap,unsigned int caps) { -strlcpy (cap->driver, dev->driver->name,sizeof (cap->driver)); -strlcpy (cap->card, dev->driver->name,sizeof (cap->card)); +strscpy (cap->driver, dev->driver->name,sizeof (cap->driver)); +strscpy (cap->card, dev->driver->name,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" ,dev_name (dev)); cap->device_caps = caps;
drivers/media/platform/exynos4-is/fimc-capture.c +1 -1
@@ -1087,7 +1087,7 @@ static int fimc_cap_enum_input(struct file *file, void *priv,fimc_md_graph_unlock (ve);if (sd) -strlcpy (i->name, sd->name,sizeof (i->name)); +strscpy (i->name, sd->name,sizeof (i->name));return 0 ; }
drivers/media/platform/exynos4-is/fimc-is-i2c.c +1 -1
@@ -57,7 +57,7 @@ static int fimc_is_i2c_probe(struct platform_device *pdev) i2c_adap = &isp_i2c->adapter; i2c_adap->dev.of_node = node; i2c_adap->dev.parent = &pdev->dev; -strlcpy (i2c_adap->name,"exynos4x12-isp-i2c" ,sizeof (i2c_adap->name)); +strscpy (i2c_adap->name,"exynos4x12-isp-i2c" ,sizeof (i2c_adap->name)); i2c_adap->owner =THIS_MODULE ; i2c_adap->algo = &fimc_is_i2c_algorithm; i2c_adap->class =I2C_CLASS_SPD ;
drivers/media/platform/exynos4-is/fimc-isp-video.c +1 -1
@@ -365,7 +365,7 @@ static int isp_video_enum_fmt_mplane(struct file *file, void *priv,if (WARN_ON (fmt ==NULL ))return -EINVAL ; -strlcpy (f->description, fmt->name,sizeof (f->description)); +strscpy (f->description, fmt->name,sizeof (f->description)); f->pixelformat = fmt->fourcc;return 0 ;
drivers/media/platform/exynos4-is/fimc-lite.c +3 -3
@@ -654,8 +654,8 @@ static int fimc_lite_querycap(struct file *file, void *priv, {struct fimc_lite *fimc =video_drvdata (file); -strlcpy (cap->driver,FIMC_LITE_DRV_NAME ,sizeof (cap->driver)); -strlcpy (cap->card,FIMC_LITE_DRV_NAME ,sizeof (cap->card)); +strscpy (cap->driver,FIMC_LITE_DRV_NAME ,sizeof (cap->driver)); +strscpy (cap->card,FIMC_LITE_DRV_NAME ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" ,dev_name (&fimc->pdev->dev));
@@ -673,7 +673,7 @@ static int fimc_lite_enum_fmt_mplane(struct file *file, void *priv,return -EINVAL ; fmt = &fimc_lite_formats[f->index]; -strlcpy (f->description, fmt->name,sizeof (f->description)); +strscpy (f->description, fmt->name,sizeof (f->description)); f->pixelformat = fmt->fourcc;return 0 ;
drivers/media/platform/exynos4-is/media-dev.c +4 -4
@@ -1204,9 +1204,9 @@ static ssize_t fimc_md_sysfs_show(struct device *dev,struct fimc_md *fmd =dev_get_drvdata (dev);if (fmd->user_subdev_api) -return strlcpy (buf,"Sub-device API (sub-dev)\n" ,PAGE_SIZE ); +return strscpy (buf,"Sub-device API (sub-dev)\n" ,PAGE_SIZE ); -return strlcpy (buf,"V4L2 video node only API (vid-dev)\n" ,PAGE_SIZE ); +return strscpy (buf,"V4L2 video node only API (vid-dev)\n" ,PAGE_SIZE ); } static ssize_t fimc_md_sysfs_store(struct device *dev,
@@ -1426,7 +1426,7 @@ static int fimc_md_probe(struct platform_device *pdev)INIT_LIST_HEAD (&fmd->pipelines); fmd->pdev = pdev; -strlcpy (fmd->media_dev.model,"SAMSUNG S5P FIMC" , +strscpy (fmd->media_dev.model,"SAMSUNG S5P FIMC" ,sizeof (fmd->media_dev.model)); fmd->media_dev.ops = &fimc_md_ops; fmd->media_dev.dev = dev;
@@ -1434,7 +1434,7 @@ static int fimc_md_probe(struct platform_device *pdev) v4l2_dev = &fmd->v4l2_dev; v4l2_dev->mdev = &fmd->media_dev; v4l2_dev->notify = fimc_sensor_notify; -strlcpy (v4l2_dev->name,"s5p-fimc-md" ,sizeof (v4l2_dev->name)); +strscpy (v4l2_dev->name,"s5p-fimc-md" ,sizeof (v4l2_dev->name)); fmd->use_isp =fimc_md_is_isp_available (dev->of_node); fmd->user_subdev_api = true;
drivers/media/platform/m2m-deinterlace.c +4 -4
@@ -438,9 +438,9 @@ static void deinterlace_device_run(void *priv)static int vidioc_querycap (struct file *file,void *priv,struct v4l2_capability *cap) { -strlcpy (cap->driver,MEM2MEM_NAME ,sizeof (cap->driver)); -strlcpy (cap->card,MEM2MEM_NAME ,sizeof (cap->card)); -strlcpy (cap->bus_info,MEM2MEM_NAME ,sizeof (cap->card)); +strscpy (cap->driver,MEM2MEM_NAME ,sizeof (cap->driver)); +strscpy (cap->card,MEM2MEM_NAME ,sizeof (cap->card)); +strscpy (cap->bus_info,MEM2MEM_NAME ,sizeof (cap->card));/* * This is only a mem-to-mem video device. The capture and output * device capability flags are left only for backward compatibility
@@ -474,7 +474,7 @@ static int enum_fmt(struct v4l2_fmtdesc *f, u32 type)if (i <NUM_FORMATS ) {/* Format found */ fmt = &formats[i]; -strlcpy (f->description, fmt->name,sizeof (f->description)); +strscpy (f->description, fmt->name,sizeof (f->description)); f->pixelformat = fmt->fourcc;return 0 ; }
drivers/media/platform/marvell-ccic/mcam-core.c +3 -3
@@ -1305,7 +1305,7 @@ static int mcam_vidioc_querycap(struct file *file, void *priv,strcpy (cap->driver,"marvell_ccic" );strcpy (cap->card,"marvell_ccic" ); -strlcpy (cap->bus_info, cam->bus_info,sizeof (cap->bus_info)); +strscpy (cap->bus_info, cam->bus_info,sizeof (cap->bus_info)); cap->device_caps =V4L2_CAP_VIDEO_CAPTURE |V4L2_CAP_READWRITE |V4L2_CAP_STREAMING ; cap->capabilities = cap->device_caps |V4L2_CAP_DEVICE_CAPS ;
@@ -1318,8 +1318,8 @@ static int mcam_vidioc_enum_fmt_vid_cap(struct file *filp, {if (fmt->index >=N_MCAM_FMTS )return -EINVAL ; -strlcpy (fmt->description, mcam_formats[fmt->index].desc, -sizeof (fmt->description)); +strscpy (fmt->description, mcam_formats[fmt->index].desc, +sizeof (fmt->description)); fmt->pixelformat = mcam_formats[fmt->index].pixelformat;return 0 ; }
drivers/media/platform/marvell-ccic/mmp-driver.c +1 -1
@@ -371,7 +371,7 @@ static int mmpcam_probe(struct platform_device *pdev) mcam->lane = pdata->lane; mcam->chip_id =MCAM_ARMADA610 ; mcam->buffer_mode = B_DMA_sg; -strlcpy (mcam->bus_info,"platform:mmp-camera" ,sizeof (mcam->bus_info)); +strscpy (mcam->bus_info,"platform:mmp-camera" ,sizeof (mcam->bus_info));spin_lock_init (&mcam->dev_lock);/* * Get our I/O memory.
drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c +2 -2
@@ -94,8 +94,8 @@ static int mtk_jpeg_querycap(struct file *file, void *priv, {struct mtk_jpeg_dev *jpeg =video_drvdata (file); -strlcpy (cap->driver,MTK_JPEG_NAME " decoder" ,sizeof (cap->driver)); -strlcpy (cap->card,MTK_JPEG_NAME " decoder" ,sizeof (cap->card)); +strscpy (cap->driver,MTK_JPEG_NAME " decoder" ,sizeof (cap->driver)); +strscpy (cap->card,MTK_JPEG_NAME " decoder" ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" ,dev_name (jpeg->dev));
drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c +3 -3
@@ -619,9 +619,9 @@ static int mtk_mdp_m2m_querycap(struct file *file, void *fh,struct mtk_mdp_ctx *ctx =fh_to_ctx (fh);struct mtk_mdp_dev *mdp = ctx->mdp_dev; -strlcpy (cap->driver,MTK_MDP_MODULE_NAME ,sizeof (cap->driver)); -strlcpy (cap->card, mdp->pdev->name,sizeof (cap->card)); -strlcpy (cap->bus_info,"platform:mt8173" ,sizeof (cap->bus_info)); +strscpy (cap->driver,MTK_MDP_MODULE_NAME ,sizeof (cap->driver)); +strscpy (cap->card, mdp->pdev->name,sizeof (cap->card)); +strscpy (cap->bus_info,"platform:mt8173" ,sizeof (cap->bus_info));return 0 ; }
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c +3 -3
@@ -613,9 +613,9 @@ static int vidioc_vdec_dqbuf(struct file *file, void *priv,static int vidioc_vdec_querycap (struct file *file,void *priv,struct v4l2_capability *cap) { -strlcpy (cap->driver,MTK_VCODEC_DEC_NAME ,sizeof (cap->driver)); -strlcpy (cap->bus_info,MTK_PLATFORM_STR ,sizeof (cap->bus_info)); -strlcpy (cap->card,MTK_PLATFORM_STR ,sizeof (cap->card)); +strscpy (cap->driver,MTK_VCODEC_DEC_NAME ,sizeof (cap->driver)); +strscpy (cap->bus_info,MTK_PLATFORM_STR ,sizeof (cap->bus_info)); +strscpy (cap->card,MTK_PLATFORM_STR ,sizeof (cap->card));return 0 ; }
drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c +3 -3
@@ -222,9 +222,9 @@ static int vidioc_enum_fmt_vid_out_mplane(struct file *file, void *prov,static int vidioc_venc_querycap (struct file *file,void *priv,struct v4l2_capability *cap) { -strlcpy (cap->driver,MTK_VCODEC_ENC_NAME ,sizeof (cap->driver)); -strlcpy (cap->bus_info,MTK_PLATFORM_STR ,sizeof (cap->bus_info)); -strlcpy (cap->card,MTK_PLATFORM_STR ,sizeof (cap->card)); +strscpy (cap->driver,MTK_VCODEC_ENC_NAME ,sizeof (cap->driver)); +strscpy (cap->bus_info,MTK_PLATFORM_STR ,sizeof (cap->bus_info)); +strscpy (cap->card,MTK_PLATFORM_STR ,sizeof (cap->card));return 0 ; }
drivers/media/platform/mx2_emmaprp.c +1 -1
@@ -413,7 +413,7 @@ static int enum_fmt(struct v4l2_fmtdesc *f, u32 type)if (i <NUM_FORMATS ) {/* Format found */ fmt = &formats[i]; -strlcpy (f->description, fmt->name,sizeof (f->description) -1 ); +strscpy (f->description, fmt->name,sizeof (f->description) -1 ); f->pixelformat = fmt->fourcc;return 0 ; }
drivers/media/platform/omap/omap_vout.c +5 -5
@@ -1041,8 +1041,8 @@ static int vidioc_querycap(struct file *file, void *fh, {struct omap_vout_device *vout = fh; -strlcpy (cap->driver,VOUT_NAME ,sizeof (cap->driver)); -strlcpy (cap->card, vout->vfd->name,sizeof (cap->card)); +strscpy (cap->driver,VOUT_NAME ,sizeof (cap->driver)); +strscpy (cap->card, vout->vfd->name,sizeof (cap->card)); cap->bus_info[0 ] ='\0' ; cap->device_caps =V4L2_CAP_STREAMING |V4L2_CAP_VIDEO_OUTPUT |V4L2_CAP_VIDEO_OUTPUT_OVERLAY ;
@@ -1060,8 +1060,8 @@ static int vidioc_enum_fmt_vid_out(struct file *file, void *fh,return -EINVAL ; fmt->flags = omap_formats[index].flags; -strlcpy (fmt->description, omap_formats[index].description, -sizeof (fmt->description)); +strscpy (fmt->description, omap_formats[index].description, +sizeof (fmt->description)); fmt->pixelformat = omap_formats[index].pixelformat;return 0 ;
@@ -1868,7 +1868,7 @@ static int __init omap_vout_setup_video_data(struct omap_vout_device *vout) vfd->release = video_device_release; vfd->ioctl_ops = &vout_ioctl_ops; -strlcpy (vfd->name,VOUT_NAME ,sizeof (vfd->name)); +strscpy (vfd->name,VOUT_NAME ,sizeof (vfd->name)); vfd->fops = &omap_vout_fops; vfd->v4l2_dev = &vout->vid_dev->v4l2_dev;
drivers/media/platform/omap3isp/isp.c +1 -1
@@ -1677,7 +1677,7 @@ static int isp_register_entities(struct isp_device *isp)int ret; isp->media_dev.dev = isp->dev; -strlcpy (isp->media_dev.model,"TI OMAP3 ISP" , +strscpy (isp->media_dev.model,"TI OMAP3 ISP" ,sizeof (isp->media_dev.model)); isp->media_dev.hw_revision = isp->revision; isp->media_dev.ops = &isp_media_ops;
drivers/media/platform/omap3isp/ispccdc.c +1 -1
@@ -2641,7 +2641,7 @@ static int ccdc_init_entities(struct isp_ccdc_device *ccdc)v4l2_subdev_init (sd, &ccdc_v4l2_ops); sd->internal_ops = &ccdc_v4l2_internal_ops; -strlcpy (sd->name,"OMAP3 ISP CCDC" ,sizeof (sd->name)); +strscpy (sd->name,"OMAP3 ISP CCDC" ,sizeof (sd->name)); sd->grp_id =1 <<16 ;/* group ID for isp subdevs */ v4l2_set_subdevdata (sd, ccdc); sd->flags |=V4L2_SUBDEV_FL_HAS_EVENTS |V4L2_SUBDEV_FL_HAS_DEVNODE ;
drivers/media/platform/omap3isp/ispccp2.c +1 -1
@@ -1070,7 +1070,7 @@ static int ccp2_init_entities(struct isp_ccp2_device *ccp2)v4l2_subdev_init (sd, &ccp2_sd_ops); sd->internal_ops = &ccp2_sd_internal_ops; -strlcpy (sd->name,"OMAP3 ISP CCP2" ,sizeof (sd->name)); +strscpy (sd->name,"OMAP3 ISP CCP2" ,sizeof (sd->name)); sd->grp_id =1 <<16 ;/* group ID for isp subdevs */ v4l2_set_subdevdata (sd, ccp2); sd->flags |=V4L2_SUBDEV_FL_HAS_DEVNODE ;
drivers/media/platform/omap3isp/ispcsi2.c +1 -1
@@ -1234,7 +1234,7 @@ static int csi2_init_entities(struct isp_csi2_device *csi2)v4l2_subdev_init (sd, &csi2_ops); sd->internal_ops = &csi2_internal_ops; -strlcpy (sd->name,"OMAP3 ISP CSI2a" ,sizeof (sd->name)); +strscpy (sd->name,"OMAP3 ISP CSI2a" ,sizeof (sd->name)); sd->grp_id =1 <<16 ;/* group ID for isp subdevs */ v4l2_set_subdevdata (sd, csi2);
drivers/media/platform/omap3isp/isppreview.c +1 -1
@@ -2267,7 +2267,7 @@ static int preview_init_entities(struct isp_prev_device *prev)v4l2_subdev_init (sd, &preview_v4l2_ops); sd->internal_ops = &preview_v4l2_internal_ops; -strlcpy (sd->name,"OMAP3 ISP preview" ,sizeof (sd->name)); +strscpy (sd->name,"OMAP3 ISP preview" ,sizeof (sd->name)); sd->grp_id =1 <<16 ;/* group ID for isp subdevs */ v4l2_set_subdevdata (sd, prev); sd->flags |=V4L2_SUBDEV_FL_HAS_DEVNODE ;
drivers/media/platform/omap3isp/ispresizer.c +1 -1
@@ -1723,7 +1723,7 @@ static int resizer_init_entities(struct isp_res_device *res)v4l2_subdev_init (sd, &resizer_v4l2_ops); sd->internal_ops = &resizer_v4l2_internal_ops; -strlcpy (sd->name,"OMAP3 ISP resizer" ,sizeof (sd->name)); +strscpy (sd->name,"OMAP3 ISP resizer" ,sizeof (sd->name)); sd->grp_id =1 <<16 ;/* group ID for isp subdevs */ v4l2_set_subdevdata (sd, res); sd->flags |=V4L2_SUBDEV_FL_HAS_DEVNODE ;
drivers/media/platform/omap3isp/ispvideo.c +4 -4
@@ -654,9 +654,9 @@ isp_video_querycap(struct file *file, void *fh, struct v4l2_capability *cap) {struct isp_video *video =video_drvdata (file); -strlcpy (cap->driver,ISP_VIDEO_DRIVER_NAME ,sizeof (cap->driver)); -strlcpy (cap->card, video->video.name,sizeof (cap->card)); -strlcpy (cap->bus_info,"media" ,sizeof (cap->bus_info)); +strscpy (cap->driver,ISP_VIDEO_DRIVER_NAME ,sizeof (cap->driver)); +strscpy (cap->card, video->video.name,sizeof (cap->card)); +strscpy (cap->bus_info,"media" ,sizeof (cap->bus_info)); cap->capabilities =V4L2_CAP_VIDEO_CAPTURE |V4L2_CAP_VIDEO_OUTPUT |V4L2_CAP_STREAMING |V4L2_CAP_DEVICE_CAPS ;
@@ -1251,7 +1251,7 @@ isp_video_enum_input(struct file *file, void *fh, struct v4l2_input *input)if (input->index >0 )return -EINVAL ; -strlcpy (input->name,"camera" ,sizeof (input->name)); +strscpy (input->name,"camera" ,sizeof (input->name)); input->type =V4L2_INPUT_TYPE_CAMERA ;return 0 ;
drivers/media/platform/pxa_camera.c +4 -4
@@ -1994,9 +1994,9 @@ static int pxac_vidioc_s_fmt_vid_cap(struct file *filp, void *priv,static int pxac_vidioc_querycap (struct file *file,void *priv,struct v4l2_capability *cap) { -strlcpy (cap->bus_info,"platform:pxa-camera" ,sizeof (cap->bus_info)); -strlcpy (cap->driver,PXA_CAM_DRV_NAME ,sizeof (cap->driver)); -strlcpy (cap->card, pxa_cam_driver_description,sizeof (cap->card)); +strscpy (cap->bus_info,"platform:pxa-camera" ,sizeof (cap->bus_info)); +strscpy (cap->driver,PXA_CAM_DRV_NAME ,sizeof (cap->driver)); +strscpy (cap->card, pxa_cam_driver_description,sizeof (cap->card)); cap->device_caps =V4L2_CAP_VIDEO_CAPTURE |V4L2_CAP_STREAMING ; cap->capabilities = cap->device_caps |V4L2_CAP_DEVICE_CAPS ;
@@ -2010,7 +2010,7 @@ static int pxac_vidioc_enum_input(struct file *file, void *priv,return -EINVAL ; i->type =V4L2_INPUT_TYPE_CAMERA ; -strlcpy (i->name,"Camera" ,sizeof (i->name)); +strscpy (i->name,"Camera" ,sizeof (i->name));return 0 ; }
drivers/media/platform/qcom/camss/camss-video.c +4 -4
@@ -521,8 +521,8 @@ static int video_querycap(struct file *file, void *fh, {struct camss_video *video =video_drvdata (file); -strlcpy (cap->driver,"qcom-camss" ,sizeof (cap->driver)); -strlcpy (cap->card,"Qualcomm Camera Subsystem" ,sizeof (cap->card)); +strscpy (cap->driver,"qcom-camss" ,sizeof (cap->driver)); +strscpy (cap->card,"Qualcomm Camera Subsystem" ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" ,dev_name (video->camss->dev));
@@ -683,7 +683,7 @@ static int video_enum_input(struct file *file, void *fh,if (input->index >0 )return -EINVAL ; -strlcpy (input->name,"camera" ,sizeof (input->name)); +strscpy (input->name,"camera" ,sizeof (input->name)); input->type =V4L2_INPUT_TYPE_CAMERA ;return 0 ;
@@ -919,7 +919,7 @@ int msm_video_register(struct camss_video *video, struct v4l2_device *v4l2_dev, vdev->vfl_dir =VFL_DIR_RX ; vdev->queue = &video->vb2_q; vdev->lock = &video->lock; -strlcpy (vdev->name, name,sizeof (vdev->name)); +strscpy (vdev->name, name,sizeof (vdev->name)); ret =video_register_device (vdev,VFL_TYPE_GRABBER ,-1 );if (ret <0 ) {
drivers/media/platform/qcom/camss/camss.c +1 -1
@@ -876,7 +876,7 @@ static int camss_probe(struct platform_device *pdev)return ret; camss->media_dev.dev = camss->dev; -strlcpy (camss->media_dev.model,"Qualcomm Camera Subsystem" , +strscpy (camss->media_dev.model,"Qualcomm Camera Subsystem" ,sizeof (camss->media_dev.model)); camss->media_dev.ops = &camss_media_ops;media_device_init (&camss->media_dev);
drivers/media/platform/qcom/venus/vdec.c +4 -4
@@ -341,9 +341,9 @@ vdec_g_selection(struct file *file, void *fh, struct v4l2_selection *s)static int vdec_querycap (struct file *file,void *fh,struct v4l2_capability *cap) { -strlcpy (cap->driver,"qcom-venus" ,sizeof (cap->driver)); -strlcpy (cap->card,"Qualcomm Venus video decoder" ,sizeof (cap->card)); -strlcpy (cap->bus_info,"platform:qcom-venus" ,sizeof (cap->bus_info)); +strscpy (cap->driver,"qcom-venus" ,sizeof (cap->driver)); +strscpy (cap->card,"Qualcomm Venus video decoder" ,sizeof (cap->card)); +strscpy (cap->bus_info,"platform:qcom-venus" ,sizeof (cap->bus_info));return 0 ; }
@@ -1153,7 +1153,7 @@ static int vdec_probe(struct platform_device *pdev)if (!vdev)return -ENOMEM ; -strlcpy (vdev->name,"qcom-venus-decoder" ,sizeof (vdev->name)); +strscpy (vdev->name,"qcom-venus-decoder" ,sizeof (vdev->name)); vdev->release = video_device_release; vdev->fops = &vdec_fops; vdev->ioctl_ops = &vdec_ioctl_ops;
drivers/media/platform/qcom/venus/venc.c +4 -4
@@ -273,9 +273,9 @@ static int venc_v4l2_to_hfi(int id, int value)static int venc_querycap (struct file *file,void *fh,struct v4l2_capability *cap) { -strlcpy (cap->driver,"qcom-venus" ,sizeof (cap->driver)); -strlcpy (cap->card,"Qualcomm Venus video encoder" ,sizeof (cap->card)); -strlcpy (cap->bus_info,"platform:qcom-venus" ,sizeof (cap->bus_info)); +strscpy (cap->driver,"qcom-venus" ,sizeof (cap->driver)); +strscpy (cap->card,"Qualcomm Venus video encoder" ,sizeof (cap->card)); +strscpy (cap->bus_info,"platform:qcom-venus" ,sizeof (cap->bus_info));return 0 ; }
@@ -1257,7 +1257,7 @@ static int venc_probe(struct platform_device *pdev)if (!vdev)return -ENOMEM ; -strlcpy (vdev->name,"qcom-venus-encoder" ,sizeof (vdev->name)); +strscpy (vdev->name,"qcom-venus-encoder" ,sizeof (vdev->name)); vdev->release = video_device_release; vdev->fops = &venc_fops; vdev->ioctl_ops = &venc_ioctl_ops;
drivers/media/platform/rcar-vin/rcar-core.c +2 -2
@@ -268,8 +268,8 @@ static int rvin_group_init(struct rvin_group *group, struct rvin_dev *vin) match =of_match_node (vin->dev->driver->of_match_table, vin->dev->of_node); -strlcpy (mdev->driver_name,KBUILD_MODNAME ,sizeof (mdev->driver_name)); -strlcpy (mdev->model, match->compatible,sizeof (mdev->model)); +strscpy (mdev->driver_name,KBUILD_MODNAME ,sizeof (mdev->driver_name)); +strscpy (mdev->model, match->compatible,sizeof (mdev->model));snprintf (mdev->bus_info,sizeof (mdev->bus_info),"platform:%s" ,dev_name (mdev->dev));
drivers/media/platform/rcar-vin/rcar-v4l2.c +4 -4
@@ -238,8 +238,8 @@ static int rvin_querycap(struct file *file, void *priv, {struct rvin_dev *vin =video_drvdata (file); -strlcpy (cap->driver,KBUILD_MODNAME ,sizeof (cap->driver)); -strlcpy (cap->card,"R_Car_VIN" ,sizeof (cap->card)); +strscpy (cap->driver,KBUILD_MODNAME ,sizeof (cap->driver)); +strscpy (cap->card,"R_Car_VIN" ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" ,dev_name (vin->dev));return 0 ;
@@ -440,7 +440,7 @@ static int rvin_enum_input(struct file *file, void *priv, i->std = vin->vdev.tvnorms; } -strlcpy (i->name,"Camera" ,sizeof (i->name)); +strscpy (i->name,"Camera" ,sizeof (i->name));return 0 ; }
@@ -714,7 +714,7 @@ static int rvin_mc_enum_input(struct file *file, void *priv,return -EINVAL ; i->type =V4L2_INPUT_TYPE_CAMERA ; -strlcpy (i->name,"Camera" ,sizeof (i->name)); +strscpy (i->name,"Camera" ,sizeof (i->name));return 0 ; }
drivers/media/platform/rcar_drif.c +2 -2
@@ -870,8 +870,8 @@ static int rcar_drif_querycap(struct file *file, void *fh, {struct rcar_drif_sdr *sdr =video_drvdata (file); -strlcpy (cap->driver,KBUILD_MODNAME ,sizeof (cap->driver)); -strlcpy (cap->card, sdr->vdev->name,sizeof (cap->card)); +strscpy (cap->driver,KBUILD_MODNAME ,sizeof (cap->driver)); +strscpy (cap->card, sdr->vdev->name,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" , sdr->vdev->name);
drivers/media/platform/rcar_fdp1.c +3 -3
@@ -1359,8 +1359,8 @@ static void device_frame_end(struct fdp1_dev *fdp1,static int fdp1_vidioc_querycap (struct file *file,void *priv,struct v4l2_capability *cap) { -strlcpy (cap->driver,DRIVER_NAME ,sizeof (cap->driver)); -strlcpy (cap->card,DRIVER_NAME ,sizeof (cap->card)); +strscpy (cap->driver,DRIVER_NAME ,sizeof (cap->driver)); +strscpy (cap->card,DRIVER_NAME ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" ,DRIVER_NAME );return 0 ;
@@ -2339,7 +2339,7 @@ static int fdp1_probe(struct platform_device *pdev) vfd->lock = &fdp1->dev_mutex; vfd->v4l2_dev = &fdp1->v4l2_dev;video_set_drvdata (vfd, fdp1); -strlcpy (vfd->name, fdp1_videodev.name,sizeof (vfd->name)); +strscpy (vfd->name, fdp1_videodev.name,sizeof (vfd->name)); ret =video_register_device (vfd,VFL_TYPE_GRABBER ,0 );if (ret) {
drivers/media/platform/rcar_jpu.c +5 -5
@@ -664,11 +664,11 @@ static int jpu_querycap(struct file *file, void *priv,struct jpu_ctx *ctx =fh_to_ctx (priv);if (ctx->encoder) -strlcpy (cap->card,DRV_NAME " encoder" ,sizeof (cap->card)); +strscpy (cap->card,DRV_NAME " encoder" ,sizeof (cap->card));else -strlcpy (cap->card,DRV_NAME " decoder" ,sizeof (cap->card)); +strscpy (cap->card,DRV_NAME " decoder" ,sizeof (cap->card)); -strlcpy (cap->driver,DRV_NAME ,sizeof (cap->driver)); +strscpy (cap->driver,DRV_NAME ,sizeof (cap->driver));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" ,dev_name (ctx->jpu->dev)); cap->device_caps |=V4L2_CAP_STREAMING |V4L2_CAP_VIDEO_M2M_MPLANE ;
@@ -1654,7 +1654,7 @@ static int jpu_probe(struct platform_device *pdev)for (i =0 ; i <JPU_MAX_QUALITY ; i++)jpu_generate_hdr (i, (unsigned char *)jpeg_hdrs[i]); -strlcpy (jpu->vfd_encoder.name,DRV_NAME ,sizeof (jpu->vfd_encoder.name)); +strscpy (jpu->vfd_encoder.name,DRV_NAME ,sizeof (jpu->vfd_encoder.name)); jpu->vfd_encoder.fops = &jpu_fops; jpu->vfd_encoder.ioctl_ops = &jpu_ioctl_ops; jpu->vfd_encoder.minor =-1 ;
@@ -1671,7 +1671,7 @@ static int jpu_probe(struct platform_device *pdev)video_set_drvdata (&jpu->vfd_encoder, jpu); -strlcpy (jpu->vfd_decoder.name,DRV_NAME ,sizeof (jpu->vfd_decoder.name)); +strscpy (jpu->vfd_decoder.name,DRV_NAME ,sizeof (jpu->vfd_decoder.name)); jpu->vfd_decoder.fops = &jpu_fops; jpu->vfd_decoder.ioctl_ops = &jpu_ioctl_ops; jpu->vfd_decoder.minor =-1 ;
drivers/media/platform/renesas-ceu.c +3 -3
@@ -1137,8 +1137,8 @@ static int ceu_querycap(struct file *file, void *priv, {struct ceu_device *ceudev =video_drvdata (file); -strlcpy (cap->card,"Renesas CEU" ,sizeof (cap->card)); -strlcpy (cap->driver,DRIVER_NAME ,sizeof (cap->driver)); +strscpy (cap->card,"Renesas CEU" ,sizeof (cap->card)); +strscpy (cap->driver,DRIVER_NAME ,sizeof (cap->driver));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:renesas-ceu-%s" ,dev_name (ceudev->dev));
@@ -1440,7 +1440,7 @@ static int ceu_notify_complete(struct v4l2_async_notifier *notifier)return ret;/* Register the video device. */ -strlcpy (vdev->name,DRIVER_NAME ,sizeof (vdev->name)); +strscpy (vdev->name,DRIVER_NAME ,sizeof (vdev->name)); vdev->v4l2_dev = v4l2_dev; vdev->lock = &ceudev->mlock; vdev->queue = &ceudev->vb2_vq;
drivers/media/platform/rockchip/rga/rga.c +3 -3
@@ -447,9 +447,9 @@ static const struct v4l2_file_operations rga_fops = {static int vidioc_querycap (struct file *file,void *priv,struct v4l2_capability *cap) { -strlcpy (cap->driver,RGA_NAME ,sizeof (cap->driver)); -strlcpy (cap->card,"rockchip-rga" ,sizeof (cap->card)); -strlcpy (cap->bus_info,"platform:rga" ,sizeof (cap->bus_info)); +strscpy (cap->driver,RGA_NAME ,sizeof (cap->driver)); +strscpy (cap->card,"rockchip-rga" ,sizeof (cap->card)); +strscpy (cap->bus_info,"platform:rga" ,sizeof (cap->bus_info));return 0 ; }
drivers/media/platform/s3c-camif/camif-capture.c +5 -5
@@ -640,8 +640,8 @@ static int s3c_camif_vidioc_querycap(struct file *file, void *priv, {struct camif_vp *vp =video_drvdata (file); -strlcpy (cap->driver,S3C_CAMIF_DRIVER_NAME ,sizeof (cap->driver)); -strlcpy (cap->card,S3C_CAMIF_DRIVER_NAME ,sizeof (cap->card)); +strscpy (cap->driver,S3C_CAMIF_DRIVER_NAME ,sizeof (cap->driver)); +strscpy (cap->card,S3C_CAMIF_DRIVER_NAME ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s.%d" ,dev_name (vp->camif->dev), vp->id);
@@ -661,7 +661,7 @@ static int s3c_camif_vidioc_enum_input(struct file *file, void *priv,return -EINVAL ; input->type =V4L2_INPUT_TYPE_CAMERA ; -strlcpy (input->name, sensor->name,sizeof (input->name)); +strscpy (input->name, sensor->name,sizeof (input->name));return 0 ; }
@@ -688,7 +688,7 @@ static int s3c_camif_vidioc_enum_fmt(struct file *file, void *priv,if (!fmt)return -EINVAL ; -strlcpy (f->description, fmt->name,sizeof (f->description)); +strscpy (f->description, fmt->name,sizeof (f->description)); f->pixelformat = fmt->fourcc;pr_debug ("fmt(%d): %s\n" , f->index, f->description);
@@ -1555,7 +1555,7 @@ int s3c_camif_create_subdev(struct camif_dev *camif)v4l2_subdev_init (sd, &s3c_camif_subdev_ops); sd->flags |=V4L2_SUBDEV_FL_HAS_DEVNODE ; -strlcpy (sd->name,"S3C-CAMIF" ,sizeof (sd->name)); +strscpy (sd->name,"S3C-CAMIF" ,sizeof (sd->name)); camif->pads[CAMIF_SD_PAD_SINK ].flags =MEDIA_PAD_FL_SINK ; camif->pads[CAMIF_SD_PAD_SOURCE_C ].flags =MEDIA_PAD_FL_SOURCE ;
drivers/media/platform/s3c-camif/camif-core.c +2 -2
@@ -316,12 +316,12 @@ static int camif_media_dev_init(struct camif_dev *camif)memset (md,0 ,sizeof (*md));snprintf (md->model,sizeof (md->model),"SAMSUNG S3C%s CAMIF" , ip_rev ==S3C6410_CAMIF_IP_REV ?"6410" :"244X" ); -strlcpy (md->bus_info,"platform" ,sizeof (md->bus_info)); +strscpy (md->bus_info,"platform" ,sizeof (md->bus_info)); md->hw_revision = ip_rev; md->dev = camif->dev; -strlcpy (v4l2_dev->name,"s3c-camif" ,sizeof (v4l2_dev->name)); +strscpy (v4l2_dev->name,"s3c-camif" ,sizeof (v4l2_dev->name)); v4l2_dev->mdev = md;media_device_init (md);
drivers/media/platform/s5p-jpeg/jpeg-core.c +5 -5
@@ -1276,14 +1276,14 @@ static int s5p_jpeg_querycap(struct file *file, void *priv,struct s5p_jpeg_ctx *ctx =fh_to_ctx (priv);if (ctx->mode ==S5P_JPEG_ENCODE ) { -strlcpy (cap->driver,S5P_JPEG_M2M_NAME , +strscpy (cap->driver,S5P_JPEG_M2M_NAME ,sizeof (cap->driver)); -strlcpy (cap->card,S5P_JPEG_M2M_NAME " encoder" , +strscpy (cap->card,S5P_JPEG_M2M_NAME " encoder" ,sizeof (cap->card)); }else { -strlcpy (cap->driver,S5P_JPEG_M2M_NAME , +strscpy (cap->driver,S5P_JPEG_M2M_NAME ,sizeof (cap->driver)); -strlcpy (cap->card,S5P_JPEG_M2M_NAME " decoder" , +strscpy (cap->card,S5P_JPEG_M2M_NAME " decoder" ,sizeof (cap->card)); } snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
@@ -1314,7 +1314,7 @@ static int enum_fmt(struct s5p_jpeg_fmt *sjpeg_formats, int n,if (i >= n)return -EINVAL ; -strlcpy (f->description, sjpeg_formats[i].name,sizeof (f->description)); +strscpy (f->description, sjpeg_formats[i].name,sizeof (f->description)); f->pixelformat = sjpeg_formats[i].fourcc;return 0 ;
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +3 -3
@@ -271,8 +271,8 @@ static int vidioc_querycap(struct file *file, void *priv, {struct s5p_mfc_dev *dev =video_drvdata (file); -strlcpy (cap->driver,S5P_MFC_NAME ,sizeof (cap->driver)); -strlcpy (cap->card, dev->vfd_dec->name,sizeof (cap->card)); +strscpy (cap->driver,S5P_MFC_NAME ,sizeof (cap->driver)); +strscpy (cap->card, dev->vfd_dec->name,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" ,dev_name (&dev->plat_dev->dev));/*
@@ -308,7 +308,7 @@ static int vidioc_enum_fmt(struct file *file, struct v4l2_fmtdesc *f,if (i ==ARRAY_SIZE (formats))return -EINVAL ; fmt = &formats[i]; -strlcpy (f->description, fmt->name,sizeof (f->description)); +strscpy (f->description, fmt->name,sizeof (f->description)); f->pixelformat = fmt->fourcc;return 0 ; }
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +3 -3
@@ -1313,8 +1313,8 @@ static int vidioc_querycap(struct file *file, void *priv, {struct s5p_mfc_dev *dev =video_drvdata (file); -strlcpy (cap->driver,S5P_MFC_NAME ,sizeof (cap->driver)); -strlcpy (cap->card, dev->vfd_enc->name,sizeof (cap->card)); +strscpy (cap->driver,S5P_MFC_NAME ,sizeof (cap->driver)); +strscpy (cap->card, dev->vfd_enc->name,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" ,dev_name (&dev->plat_dev->dev));/*
@@ -1344,7 +1344,7 @@ static int vidioc_enum_fmt(struct file *file, struct v4l2_fmtdesc *f,if (j == f->index) { fmt = &formats[i]; -strlcpy (f->description, fmt->name, +strscpy (f->description, fmt->name,sizeof (f->description)); f->pixelformat = fmt->fourcc;return 0 ;
drivers/media/platform/sh_veu.c +5 -4
@@ -345,9 +345,9 @@ static int sh_veu_context_init(struct sh_veu_dev *veu)static int sh_veu_querycap (struct file *file,void *priv,struct v4l2_capability *cap) { -strlcpy (cap->driver,"sh-veu" ,sizeof (cap->driver)); -strlcpy (cap->card,"sh-mobile VEU" ,sizeof (cap->card)); -strlcpy (cap->bus_info,"platform:sh-veu" ,sizeof (cap->bus_info)); +strscpy (cap->driver,"sh-veu" ,sizeof (cap->driver)); +strscpy (cap->card,"sh-mobile VEU" ,sizeof (cap->card)); +strscpy (cap->bus_info,"platform:sh-veu" ,sizeof (cap->bus_info)); cap->device_caps =V4L2_CAP_VIDEO_M2M |V4L2_CAP_STREAMING ; cap->capabilities = cap->device_caps |V4L2_CAP_DEVICE_CAPS ;
@@ -359,7 +359,8 @@ static int sh_veu_enum_fmt(struct v4l2_fmtdesc *f, const int *fmt, int fmt_num)if (f->index >= fmt_num)return -EINVAL ; -strlcpy (f->description, sh_veu_fmt[fmt[f->index]].name,sizeof (f->description)); +strscpy (f->description, sh_veu_fmt[fmt[f->index]].name, +sizeof (f->description)); f->pixelformat = sh_veu_fmt[fmt[f->index]].fourcc;return 0 ; }
drivers/media/platform/sh_vou.c +5 -5
@@ -378,9 +378,9 @@ static int sh_vou_querycap(struct file *file, void *priv,dev_dbg (vou_dev->v4l2_dev.dev,"%s()\n" , __func__); -strlcpy (cap->card,"SuperH VOU" ,sizeof (cap->card)); -strlcpy (cap->driver,"sh-vou" ,sizeof (cap->driver)); -strlcpy (cap->bus_info,"platform:sh-vou" ,sizeof (cap->bus_info)); +strscpy (cap->card,"SuperH VOU" ,sizeof (cap->card)); +strscpy (cap->driver,"sh-vou" ,sizeof (cap->driver)); +strscpy (cap->bus_info,"platform:sh-vou" ,sizeof (cap->bus_info)); cap->device_caps =V4L2_CAP_VIDEO_OUTPUT |V4L2_CAP_READWRITE |V4L2_CAP_STREAMING ; cap->capabilities = cap->device_caps |V4L2_CAP_DEVICE_CAPS ;
@@ -399,7 +399,7 @@ static int sh_vou_enum_fmt_vid_out(struct file *file, void *priv,dev_dbg (vou_dev->v4l2_dev.dev,"%s()\n" , __func__); fmt->type =V4L2_BUF_TYPE_VIDEO_OUTPUT ; -strlcpy (fmt->description, vou_fmt[fmt->index].desc, +strscpy (fmt->description, vou_fmt[fmt->index].desc,sizeof (fmt->description)); fmt->pixelformat = vou_fmt[fmt->index].pfmt;
@@ -790,7 +790,7 @@ static int sh_vou_enum_output(struct file *file, void *fh,if (a->index)return -EINVAL ; -strlcpy (a->name,"Video Out" ,sizeof (a->name)); +strscpy (a->name,"Video Out" ,sizeof (a->name)); a->type =V4L2_OUTPUT_TYPE_ANALOG ; a->std = vou_dev->vdev.tvnorms;return 0 ;
drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c +3 -3
@@ -1564,9 +1564,9 @@ static __poll_t sh_mobile_ceu_poll(struct file *file, poll_table *pt)static int sh_mobile_ceu_querycap (struct soc_camera_host *ici,struct v4l2_capability *cap) { -strlcpy (cap->card,"SuperH_Mobile_CEU" ,sizeof (cap->card)); -strlcpy (cap->driver,"sh_mobile_ceu" ,sizeof (cap->driver)); -strlcpy (cap->bus_info,"platform:sh_mobile_ceu" ,sizeof (cap->bus_info)); +strscpy (cap->card,"SuperH_Mobile_CEU" ,sizeof (cap->card)); +strscpy (cap->driver,"sh_mobile_ceu" ,sizeof (cap->driver)); +strscpy (cap->bus_info,"platform:sh_mobile_ceu" ,sizeof (cap->bus_info)); cap->device_caps =V4L2_CAP_VIDEO_CAPTURE |V4L2_CAP_STREAMING ; cap->capabilities = cap->device_caps |V4L2_CAP_DEVICE_CAPS ;
drivers/media/platform/soc_camera/soc_camera.c +3 -3
@@ -874,7 +874,7 @@ static int soc_camera_enum_fmt_vid_cap(struct file *file, void *priv, format = icd->user_formats[f->index].host_fmt;if (format->name) -strlcpy (f->description, format->name,sizeof (f->description)); +strscpy (f->description, format->name,sizeof (f->description)); f->pixelformat = format->fourcc;return 0 ; }
@@ -910,7 +910,7 @@ static int soc_camera_querycap(struct file *file, void *priv,WARN_ON (priv != file->private_data); -strlcpy (cap->driver, ici->drv_name,sizeof (cap->driver)); +strscpy (cap->driver, ici->drv_name,sizeof (cap->driver));return ici->ops->querycap (ici, cap); }
@@ -2026,7 +2026,7 @@ static int video_dev_create(struct soc_camera_device *icd)if (!vdev)return -ENOMEM ; -strlcpy (vdev->name, ici->drv_name,sizeof (vdev->name)); +strscpy (vdev->name, ici->drv_name,sizeof (vdev->name)); vdev->v4l2_dev = &ici->v4l2_dev; vdev->fops = &soc_camera_fops;
drivers/media/platform/soc_camera/soc_camera_platform.c +1 -1
@@ -156,7 +156,7 @@ static int soc_camera_platform_probe(struct platform_device *pdev)v4l2_subdev_init (&priv->subdev, &platform_subdev_ops);v4l2_set_subdevdata (&priv->subdev, p); -strlcpy (priv->subdev.name,dev_name (&pdev->dev), +strscpy (priv->subdev.name,dev_name (&pdev->dev),sizeof (priv->subdev.name));return v4l2_device_register_subdev (&ici->v4l2_dev, &priv->subdev);
drivers/media/platform/sti/bdisp/bdisp-v4l2.c +2 -2
@@ -688,8 +688,8 @@ static int bdisp_querycap(struct file *file, void *fh,struct bdisp_ctx *ctx =fh_to_ctx (fh);struct bdisp_dev *bdisp = ctx->bdisp_dev; -strlcpy (cap->driver, bdisp->pdev->name,sizeof (cap->driver)); -strlcpy (cap->card, bdisp->pdev->name,sizeof (cap->card)); +strscpy (cap->driver, bdisp->pdev->name,sizeof (cap->driver)); +strscpy (cap->card, bdisp->pdev->name,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s%d" ,BDISP_NAME , bdisp->id);
drivers/media/platform/sti/delta/delta-v4l2.c +2 -2
@@ -385,8 +385,8 @@ static int delta_querycap(struct file *file, void *priv,struct delta_ctx *ctx =to_ctx (file->private_data);struct delta_dev *delta = ctx->dev; -strlcpy (cap->driver,DELTA_NAME ,sizeof (cap->driver)); -strlcpy (cap->card, delta->vdev->name,sizeof (cap->card)); +strscpy (cap->driver,DELTA_NAME ,sizeof (cap->driver)); +strscpy (cap->card, delta->vdev->name,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" , delta->pdev->name);
drivers/media/platform/sti/hva/hva-v4l2.c +2 -2
@@ -257,8 +257,8 @@ static int hva_querycap(struct file *file, void *priv,struct hva_ctx *ctx =fh_to_ctx (file->private_data);struct hva_dev *hva =ctx_to_hdev (ctx); -strlcpy (cap->driver,HVA_NAME ,sizeof (cap->driver)); -strlcpy (cap->card, hva->vdev->name,sizeof (cap->card)); +strscpy (cap->driver,HVA_NAME ,sizeof (cap->driver)); +strscpy (cap->card, hva->vdev->name,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" , hva->pdev->name);
drivers/media/platform/stm32/stm32-dcmi.c +5 -5
@@ -1147,10 +1147,10 @@ static int dcmi_s_selection(struct file *file, void *priv,static int dcmi_querycap (struct file *file,void *priv,struct v4l2_capability *cap) { -strlcpy (cap->driver,DRV_NAME ,sizeof (cap->driver)); -strlcpy (cap->card,"STM32 Camera Memory Interface" , +strscpy (cap->driver,DRV_NAME ,sizeof (cap->driver)); +strscpy (cap->card,"STM32 Camera Memory Interface" ,sizeof (cap->card)); -strlcpy (cap->bus_info,"platform:dcmi" ,sizeof (cap->bus_info)); +strscpy (cap->bus_info,"platform:dcmi" ,sizeof (cap->bus_info));return 0 ; }
@@ -1161,7 +1161,7 @@ static int dcmi_enum_input(struct file *file, void *priv,return -EINVAL ; i->type =V4L2_INPUT_TYPE_CAMERA ; -strlcpy (i->name,"Camera" ,sizeof (i->name)); +strscpy (i->name,"Camera" ,sizeof (i->name));return 0 ; }
@@ -1736,7 +1736,7 @@ static int dcmi_probe(struct platform_device *pdev) dcmi->vdev->fops = &dcmi_fops; dcmi->vdev->v4l2_dev = &dcmi->v4l2_dev; dcmi->vdev->queue = &dcmi->queue; -strlcpy (dcmi->vdev->name,KBUILD_MODNAME ,sizeof (dcmi->vdev->name)); +strscpy (dcmi->vdev->name,KBUILD_MODNAME ,sizeof (dcmi->vdev->name)); dcmi->vdev->release = video_device_release; dcmi->vdev->ioctl_ops = &dcmi_ioctl_ops; dcmi->vdev->lock = &dcmi->lock;
drivers/media/platform/ti-vpe/cal.c +3 -3
@@ -912,8 +912,8 @@ static int cal_querycap(struct file *file, void *priv, {struct cal_ctx *ctx =video_drvdata (file); -strlcpy (cap->driver,CAL_MODULE_NAME ,sizeof (cap->driver)); -strlcpy (cap->card,CAL_MODULE_NAME ,sizeof (cap->card)); +strscpy (cap->driver,CAL_MODULE_NAME ,sizeof (cap->driver)); +strscpy (cap->card,CAL_MODULE_NAME ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" , ctx->v4l2_dev.name);
@@ -1818,7 +1818,7 @@ static int cal_probe(struct platform_device *pdev)return -ENOMEM ;/* set pseudo v4l2 device name so we can use v4l2_printk */ -strlcpy (dev->v4l2_dev.name,CAL_MODULE_NAME , +strscpy (dev->v4l2_dev.name,CAL_MODULE_NAME ,sizeof (dev->v4l2_dev.name));/* save pdev pointer */
drivers/media/platform/via-camera.c +2 -2
@@ -860,8 +860,8 @@ static int viacam_enum_fmt_vid_cap(struct file *filp, void *priv, {if (fmt->index >=N_VIA_FMTS )return -EINVAL ; -strlcpy (fmt->description, via_formats[fmt->index].desc, -sizeof (fmt->description)); +strscpy (fmt->description, via_formats[fmt->index].desc, +sizeof (fmt->description)); fmt->pixelformat = via_formats[fmt->index].pixelformat;return 0 ; }
drivers/media/platform/vicodec/vicodec-core.c +3 -3
@@ -1283,7 +1283,7 @@ static int vicodec_probe(struct platform_device *pdev)#ifdef CONFIG_MEDIA_CONTROLLER dev->mdev.dev = &pdev->dev; -strlcpy (dev->mdev.model,"vicodec" ,sizeof (dev->mdev.model)); +strscpy (dev->mdev.model,"vicodec" ,sizeof (dev->mdev.model));media_device_init (&dev->mdev); dev->v4l2_dev.mdev = &dev->mdev;#endif
@@ -1311,7 +1311,7 @@ static int vicodec_probe(struct platform_device *pdev) vfd = &dev->enc_vfd; vfd->lock = &dev->enc_mutex; vfd->v4l2_dev = &dev->v4l2_dev; -strlcpy (vfd->name,"vicodec-enc" ,sizeof (vfd->name)); +strscpy (vfd->name,"vicodec-enc" ,sizeof (vfd->name));v4l2_disable_ioctl (vfd,VIDIOC_DECODER_CMD );v4l2_disable_ioctl (vfd,VIDIOC_TRY_DECODER_CMD );video_set_drvdata (vfd, dev);
@@ -1328,7 +1328,7 @@ static int vicodec_probe(struct platform_device *pdev) vfd = &dev->dec_vfd; vfd->lock = &dev->dec_mutex; vfd->v4l2_dev = &dev->v4l2_dev; -strlcpy (vfd->name,"vicodec-dec" ,sizeof (vfd->name)); +strscpy (vfd->name,"vicodec-dec" ,sizeof (vfd->name));v4l2_disable_ioctl (vfd,VIDIOC_ENCODER_CMD );v4l2_disable_ioctl (vfd,VIDIOC_TRY_ENCODER_CMD );video_set_drvdata (vfd, dev);
drivers/media/platform/vim2m.c +1 -1
@@ -1038,7 +1038,7 @@ static int vim2m_probe(struct platform_device *pdev)#ifdef CONFIG_MEDIA_CONTROLLER dev->mdev.dev = &pdev->dev; -strlcpy (dev->mdev.model,"vim2m" ,sizeof (dev->mdev.model)); +strscpy (dev->mdev.model,"vim2m" ,sizeof (dev->mdev.model));media_device_init (&dev->mdev); dev->v4l2_dev.mdev = &dev->mdev;
drivers/media/platform/vimc/vimc-capture.c +3 -3
@@ -71,8 +71,8 @@ static int vimc_cap_querycap(struct file *file, void *priv, {struct vimc_cap_device *vcap =video_drvdata (file); -strlcpy (cap->driver,KBUILD_MODNAME ,sizeof (cap->driver)); -strlcpy (cap->card,KBUILD_MODNAME ,sizeof (cap->card)); +strscpy (cap->driver,KBUILD_MODNAME ,sizeof (cap->driver)); +strscpy (cap->card,KBUILD_MODNAME ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" , vcap->vdev.v4l2_dev->name);
@@ -476,7 +476,7 @@ static int vimc_cap_comp_bind(struct device *comp, struct device *master, vdev->queue = q; vdev->v4l2_dev = v4l2_dev; vdev->vfl_dir =VFL_DIR_RX ; -strlcpy (vdev->name, pdata->entity_name,sizeof (vdev->name)); +strscpy (vdev->name, pdata->entity_name,sizeof (vdev->name));video_set_drvdata (vdev, &vcap->ved);/* Register the video_device with the v4l2 and the media framework */
drivers/media/platform/vimc/vimc-common.c +1 -1
@@ -430,7 +430,7 @@ int vimc_ent_sd_register(struct vimc_ent_device *ved, sd->entity.function = function; sd->entity.ops = &vimc_ent_sd_mops; sd->owner =THIS_MODULE ; -strlcpy (sd->name, name,sizeof (sd->name)); +strscpy (sd->name, name,sizeof (sd->name));v4l2_set_subdevdata (sd, ved);/* Expose this subdev to user space */
drivers/media/platform/vimc/vimc-core.c +2 -2
@@ -259,7 +259,7 @@ static struct component_match *vimc_add_subdevs(struct vimc_device *vimc)dev_dbg (&vimc->pdev.dev,"new pdev for %s\n" , vimc->pipe_cfg->ents[i].drv); -strlcpy (pdata.entity_name, vimc->pipe_cfg->ents[i].name, +strscpy (pdata.entity_name, vimc->pipe_cfg->ents[i].name,sizeof (pdata.entity_name)); vimc->subdevs[i] = platform_device_register_data(&vimc->pdev.dev,
@@ -317,7 +317,7 @@ static int vimc_probe(struct platform_device *pdev) vimc->v4l2_dev.mdev = &vimc->mdev;/* Initialize media device */ -strlcpy (vimc->mdev.model,VIMC_MDEV_MODEL_NAME , +strscpy (vimc->mdev.model,VIMC_MDEV_MODEL_NAME ,sizeof (vimc->mdev.model)); vimc->mdev.dev = &pdev->dev;media_device_init (&vimc->mdev);
drivers/media/platform/vivid/vivid-osd.c +1 -1
@@ -110,7 +110,7 @@ static int vivid_fb_get_fix(struct vivid_dev *dev, struct fb_fix_screeninfo *fix {dprintk (dev,1 ,"vivid_fb_get_fix\n" );memset (fix,0 ,sizeof (struct fb_fix_screeninfo )); -strlcpy (fix->id,"vioverlay fb" ,sizeof (fix->id)); +strscpy (fix->id,"vioverlay fb" ,sizeof (fix->id)); fix->smem_start = dev->video_pbase; fix->smem_len = dev->video_buffer_size; fix->type =FB_TYPE_PACKED_PIXELS ;
drivers/media/platform/vivid/vivid-radio-common.c +2 -2
@@ -76,10 +76,10 @@ void vivid_radio_rds_init(struct vivid_dev *dev) rds->ta = dev->radio_tx_rds_ta->cur.val; rds->tp = dev->radio_tx_rds_tp->cur.val; rds->ms = dev->radio_tx_rds_ms->cur.val; -strlcpy (rds->psname, +strscpy (rds->psname, dev->radio_tx_rds_psname->p_cur.p_char,sizeof (rds->psname)); -strlcpy (rds->radiotext, +strscpy (rds->radiotext, dev->radio_tx_rds_radiotext->p_cur.p_char + alt *64 ,sizeof (rds->radiotext));v4l2_ctrl_unlock (dev->radio_tx_rds_pi);
drivers/media/platform/vivid/vivid-radio-rx.c +1 -1
@@ -223,7 +223,7 @@ int vivid_radio_rx_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)if (vt->index >0 )return -EINVAL ; -strlcpy (vt->name,"AM/FM/SW Receiver" ,sizeof (vt->name)); +strscpy (vt->name,"AM/FM/SW Receiver" ,sizeof (vt->name)); vt->capability =V4L2_TUNER_CAP_LOW |V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_FREQ_BANDS | V4L2_TUNER_CAP_RDS | (dev->radio_rx_rds_controls ?
drivers/media/platform/vivid/vivid-radio-tx.c +1 -1
@@ -103,7 +103,7 @@ int vidioc_g_modulator(struct file *file, void *fh, struct v4l2_modulator *a)if (a->index >0 )return -EINVAL ; -strlcpy (a->name,"AM/FM/SW Transmitter" ,sizeof (a->name)); +strscpy (a->name,"AM/FM/SW Transmitter" ,sizeof (a->name)); a->capability =V4L2_TUNER_CAP_LOW |V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_FREQ_BANDS | V4L2_TUNER_CAP_RDS | (dev->radio_tx_rds_controls ?
drivers/media/platform/vivid/vivid-rds-gen.c +2 -2
@@ -147,11 +147,11 @@ void vivid_rds_gen_fill(struct vivid_rds_gen *rds, unsigned freq,snprintf (rds->psname,sizeof (rds->psname),"%6d.%1d" , freq /16 , ((freq &0xf ) *10 ) /16 );if (alt) -strlcpy (rds->radiotext, +strscpy (rds->radiotext," The Radio Data System can switch between different Radio Texts " ,sizeof (rds->radiotext));else -strlcpy (rds->radiotext, +strscpy (rds->radiotext,"An example of Radio Text as transmitted by the Radio Data System" ,sizeof (rds->radiotext)); }
drivers/media/platform/vivid/vivid-sdr-cap.c +2 -2
@@ -396,7 +396,7 @@ int vivid_sdr_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt) {switch (vt->index) {case 0 : -strlcpy (vt->name,"ADC" ,sizeof (vt->name)); +strscpy (vt->name,"ADC" ,sizeof (vt->name)); vt->type =V4L2_TUNER_ADC ; vt->capability =V4L2_TUNER_CAP_1HZ |V4L2_TUNER_CAP_FREQ_BANDS ;
@@ -404,7 +404,7 @@ int vivid_sdr_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt) vt->rangehigh = bands_adc[2 ].rangehigh;return 0 ;case 1 : -strlcpy (vt->name,"RF" ,sizeof (vt->name)); +strscpy (vt->name,"RF" ,sizeof (vt->name)); vt->type =V4L2_TUNER_RF ; vt->capability =V4L2_TUNER_CAP_1HZ |V4L2_TUNER_CAP_FREQ_BANDS ;
drivers/media/platform/vivid/vivid-vid-cap.c +1 -1
@@ -1505,7 +1505,7 @@ int vivid_video_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)break ; } } -strlcpy (vt->name,"TV Tuner" ,sizeof (vt->name)); +strscpy (vt->name,"TV Tuner" ,sizeof (vt->name));return 0 ; }
drivers/media/platform/vsp1/vsp1_drv.c +1 -1
@@ -242,7 +242,7 @@ static int vsp1_create_entities(struct vsp1_device *vsp1) mdev->dev = vsp1->dev; mdev->hw_revision = vsp1->version; -strlcpy (mdev->model, vsp1->info->model,sizeof (mdev->model)); +strscpy (mdev->model, vsp1->info->model,sizeof (mdev->model));snprintf (mdev->bus_info,sizeof (mdev->bus_info),"platform:%s" ,dev_name (mdev->dev));media_device_init (mdev);
drivers/media/platform/vsp1/vsp1_histo.c +2 -2
@@ -429,8 +429,8 @@ static int histo_v4l2_querycap(struct file *file, void *fh, cap->device_caps =V4L2_CAP_META_CAPTURE |V4L2_CAP_STREAMING ; -strlcpy (cap->driver,"vsp1" ,sizeof (cap->driver)); -strlcpy (cap->card, histo->video.name,sizeof (cap->card)); +strscpy (cap->driver,"vsp1" ,sizeof (cap->driver)); +strscpy (cap->card, histo->video.name,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" ,dev_name (histo->entity.vsp1->dev));
drivers/media/platform/vsp1/vsp1_video.c +2 -2
@@ -976,8 +976,8 @@ vsp1_video_querycap(struct file *file, void *fh, struct v4l2_capability *cap) cap->device_caps =V4L2_CAP_VIDEO_OUTPUT_MPLANE |V4L2_CAP_STREAMING ; -strlcpy (cap->driver,"vsp1" ,sizeof (cap->driver)); -strlcpy (cap->card, video->video.name,sizeof (cap->card)); +strscpy (cap->driver,"vsp1" ,sizeof (cap->driver)); +strscpy (cap->card, video->video.name,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" ,dev_name (video->vsp1->dev));
drivers/media/platform/xilinx/xilinx-dma.c +3 -3
@@ -504,8 +504,8 @@ xvip_dma_querycap(struct file *file, void *fh, struct v4l2_capability *cap) cap->capabilities = cap->device_caps |V4L2_CAP_DEVICE_CAPS | dma->xdev->v4l2_caps; -strlcpy (cap->driver,"xilinx-vipp" ,sizeof (cap->driver)); -strlcpy (cap->card, dma->video.name,sizeof (cap->card)); +strscpy (cap->driver,"xilinx-vipp" ,sizeof (cap->driver)); +strscpy (cap->card, dma->video.name,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s:%u" , dma->xdev->dev->of_node->name, dma->port);
@@ -527,7 +527,7 @@ xvip_dma_enum_format(struct file *file, void *fh, struct v4l2_fmtdesc *f)return -EINVAL ; f->pixelformat = dma->format.pixelformat; -strlcpy (f->description, dma->fmtinfo->description, +strscpy (f->description, dma->fmtinfo->description,sizeof (f->description));return 0 ;
drivers/media/platform/xilinx/xilinx-tpg.c +1 -1
@@ -833,7 +833,7 @@ static int xtpg_probe(struct platform_device *pdev)v4l2_subdev_init (subdev, &xtpg_ops); subdev->dev = &pdev->dev; subdev->internal_ops = &xtpg_internal_ops; -strlcpy (subdev->name,dev_name (&pdev->dev),sizeof (subdev->name)); +strscpy (subdev->name,dev_name (&pdev->dev),sizeof (subdev->name));v4l2_set_subdevdata (subdev, xtpg); subdev->flags |=V4L2_SUBDEV_FL_HAS_DEVNODE ; subdev->entity.ops = &xtpg_media_ops;
drivers/media/platform/xilinx/xilinx-vipp.c +1 -1
@@ -578,7 +578,7 @@ static int xvip_composite_v4l2_init(struct xvip_composite_device *xdev)int ret; xdev->media_dev.dev = xdev->dev; -strlcpy (xdev->media_dev.model,"Xilinx Video Composite Device" , +strscpy (xdev->media_dev.model,"Xilinx Video Composite Device" ,sizeof (xdev->media_dev.model)); xdev->media_dev.hw_revision =0 ;
drivers/media/radio/dsbr100.c +4 -3
@@ -174,8 +174,8 @@ static int vidioc_querycap(struct file *file, void *priv, {struct dsbr100_device *radio =video_drvdata (file); -strlcpy (v->driver,"dsbr100" ,sizeof (v->driver)); -strlcpy (v->card,"D-Link R-100 USB FM Radio" ,sizeof (v->card)); +strscpy (v->driver,"dsbr100" ,sizeof (v->driver)); +strscpy (v->card,"D-Link R-100 USB FM Radio" ,sizeof (v->card));usb_make_path (radio->usbdev, v->bus_info,sizeof (v->bus_info)); v->device_caps =V4L2_CAP_RADIO |V4L2_CAP_TUNER ; v->capabilities = v->device_caps |V4L2_CAP_DEVICE_CAPS ;
@@ -379,7 +379,8 @@ static int usb_dsbr100_probe(struct usb_interface *intf, goto err_reg_ctrl; }mutex_init (&radio->v4l2_lock); -strlcpy (radio->videodev.name, v4l2_dev->name,sizeof (radio->videodev.name)); +strscpy (radio->videodev.name, v4l2_dev->name, +sizeof (radio->videodev.name)); radio->videodev.v4l2_dev = v4l2_dev; radio->videodev.fops = &usb_dsbr100_fops; radio->videodev.ioctl_ops = &usb_dsbr100_ioctl_ops;
drivers/media/radio/radio-cadet.c +6 -6
@@ -353,9 +353,9 @@ static ssize_t cadet_read(struct file *file, char __user *data, size_t count, lostatic int vidioc_querycap (struct file *file,void *priv,struct v4l2_capability *v) { -strlcpy (v->driver,"ADS Cadet" ,sizeof (v->driver)); -strlcpy (v->card,"ADS Cadet" ,sizeof (v->card)); -strlcpy (v->bus_info,"ISA:radio-cadet" ,sizeof (v->bus_info)); +strscpy (v->driver,"ADS Cadet" ,sizeof (v->driver)); +strscpy (v->card,"ADS Cadet" ,sizeof (v->card)); +strscpy (v->bus_info,"ISA:radio-cadet" ,sizeof (v->bus_info)); v->device_caps =V4L2_CAP_TUNER |V4L2_CAP_RADIO |V4L2_CAP_READWRITE |V4L2_CAP_RDS_CAPTURE ; v->capabilities = v->device_caps |V4L2_CAP_DEVICE_CAPS ;
@@ -370,7 +370,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,if (v->index)return -EINVAL ; v->type =V4L2_TUNER_RADIO ; -strlcpy (v->name,"Radio" ,sizeof (v->name)); +strscpy (v->name,"Radio" ,sizeof (v->name)); v->capability = bands[0 ].capability | bands[1 ].capability; v->rangelow = bands[0 ].rangelow;/* 520 kHz (start of AM band) */ v->rangehigh = bands[1 ].rangehigh;/* 108.0 MHz (end of FM band) */
@@ -595,7 +595,7 @@ static int __init cadet_init(void)struct v4l2_ctrl_handler *hdl;int res = -ENODEV ; -strlcpy (v4l2_dev->name,"cadet" ,sizeof (v4l2_dev->name)); +strscpy (v4l2_dev->name,"cadet" ,sizeof (v4l2_dev->name));mutex_init (&dev->lock);/* If a probe was requested then probe ISAPnP first (safest) */
@@ -639,7 +639,7 @@ static int __init cadet_init(void) dev->is_fm_band = true; dev->curfreq = bands[dev->is_fm_band].rangelow;cadet_setfreq (dev, dev->curfreq); -strlcpy (dev->vdev.name, v4l2_dev->name,sizeof (dev->vdev.name)); +strscpy (dev->vdev.name, v4l2_dev->name,sizeof (dev->vdev.name)); dev->vdev.v4l2_dev = v4l2_dev; dev->vdev.fops = &cadet_fops; dev->vdev.ioctl_ops = &cadet_ioctl_ops;
drivers/media/radio/radio-isa.c +5 -5
@@ -42,8 +42,8 @@ static int radio_isa_querycap(struct file *file, void *priv, {struct radio_isa_card *isa =video_drvdata (file); -strlcpy (v->driver, isa->drv->driver.driver.name,sizeof (v->driver)); -strlcpy (v->card, isa->drv->card,sizeof (v->card)); +strscpy (v->driver, isa->drv->driver.driver.name,sizeof (v->driver)); +strscpy (v->card, isa->drv->card,sizeof (v->card));snprintf (v->bus_info,sizeof (v->bus_info),"ISA:%s" , isa->v4l2_dev.name); v->device_caps =V4L2_CAP_TUNER |V4L2_CAP_RADIO ;
@@ -60,7 +60,7 @@ static int radio_isa_g_tuner(struct file *file, void *priv,if (v->index >0 )return -EINVAL ; -strlcpy (v->name,"FM" ,sizeof (v->name)); +strscpy (v->name,"FM" ,sizeof (v->name)); v->type =V4L2_TUNER_RADIO ; v->rangelow =FREQ_LOW ; v->rangehigh =FREQ_HIGH ;
@@ -198,7 +198,7 @@ static struct radio_isa_card *radio_isa_alloc(struct radio_isa_driver *drv,dev_set_drvdata (pdev, isa); isa->drv = drv; v4l2_dev = &isa->v4l2_dev; -strlcpy (v4l2_dev->name,dev_name (pdev),sizeof (v4l2_dev->name)); +strscpy (v4l2_dev->name,dev_name (pdev),sizeof (v4l2_dev->name));return isa; }
@@ -243,7 +243,7 @@ static int radio_isa_common_probe(struct radio_isa_card *isa,mutex_init (&isa->lock); isa->vdev.lock = &isa->lock; -strlcpy (isa->vdev.name, v4l2_dev->name,sizeof (isa->vdev.name)); +strscpy (isa->vdev.name, v4l2_dev->name,sizeof (isa->vdev.name)); isa->vdev.v4l2_dev = v4l2_dev; isa->vdev.fops = &radio_isa_fops; isa->vdev.ioctl_ops = &radio_isa_ioctl_ops;
drivers/media/radio/radio-keene.c +4 -4
@@ -174,8 +174,8 @@ static int vidioc_querycap(struct file *file, void *priv, {struct keene_device *radio =video_drvdata (file); -strlcpy (v->driver,"radio-keene" ,sizeof (v->driver)); -strlcpy (v->card,"Keene FM Transmitter" ,sizeof (v->card)); +strscpy (v->driver,"radio-keene" ,sizeof (v->driver)); +strscpy (v->card,"Keene FM Transmitter" ,sizeof (v->card));usb_make_path (radio->usbdev, v->bus_info,sizeof (v->bus_info)); v->device_caps =V4L2_CAP_RADIO |V4L2_CAP_MODULATOR ; v->capabilities = v->device_caps |V4L2_CAP_DEVICE_CAPS ;
@@ -190,7 +190,7 @@ static int vidioc_g_modulator(struct file *file, void *priv,if (v->index >0 )return -EINVAL ; -strlcpy (v->name,"FM" ,sizeof (v->name)); +strscpy (v->name,"FM" ,sizeof (v->name)); v->rangelow =FREQ_MIN *FREQ_MUL ; v->rangehigh =FREQ_MAX *FREQ_MUL ; v->txsubchans = radio->stereo ?V4L2_TUNER_SUB_STEREO :V4L2_TUNER_SUB_MONO ;
@@ -362,7 +362,7 @@ static int usb_keene_probe(struct usb_interface *intf, radio->v4l2_dev.ctrl_handler = hdl; radio->v4l2_dev.release = usb_keene_video_device_release; -strlcpy (radio->vdev.name, radio->v4l2_dev.name, +strscpy (radio->vdev.name, radio->v4l2_dev.name,sizeof (radio->vdev.name)); radio->vdev.v4l2_dev = &radio->v4l2_dev; radio->vdev.fops = &usb_keene_fops;
drivers/media/radio/radio-ma901.c +3 -3
@@ -197,8 +197,8 @@ static int vidioc_querycap(struct file *file, void *priv, {struct ma901radio_device *radio =video_drvdata (file); -strlcpy (v->driver,"radio-ma901" ,sizeof (v->driver)); -strlcpy (v->card,"Masterkit MA901 USB FM Radio" ,sizeof (v->card)); +strscpy (v->driver,"radio-ma901" ,sizeof (v->driver)); +strscpy (v->card,"Masterkit MA901 USB FM Radio" ,sizeof (v->card));usb_make_path (radio->usbdev, v->bus_info,sizeof (v->bus_info)); v->device_caps =V4L2_CAP_RADIO |V4L2_CAP_TUNER ; v->capabilities = v->device_caps |V4L2_CAP_DEVICE_CAPS ;
@@ -400,7 +400,7 @@ static int usb_ma901radio_probe(struct usb_interface *intf, radio->v4l2_dev.ctrl_handler = &radio->hdl; radio->v4l2_dev.release = usb_ma901radio_release; -strlcpy (radio->vdev.name, radio->v4l2_dev.name, +strscpy (radio->vdev.name, radio->v4l2_dev.name,sizeof (radio->vdev.name)); radio->vdev.v4l2_dev = &radio->v4l2_dev; radio->vdev.fops = &usb_ma901radio_fops;
drivers/media/radio/radio-maxiradio.c +1 -1
@@ -142,7 +142,7 @@ static int maxiradio_probe(struct pci_dev *pdev, dev->tea.cannot_read_data = true; dev->tea.v4l2_dev = v4l2_dev; dev->tea.radio_nr = radio_nr; -strlcpy (dev->tea.card,"Maxi Radio FM2000" ,sizeof (dev->tea.card)); +strscpy (dev->tea.card,"Maxi Radio FM2000" ,sizeof (dev->tea.card));snprintf (dev->tea.bus_info,sizeof (dev->tea.bus_info),"PCI:%s" ,pci_name (pdev));
drivers/media/radio/radio-miropcm20.c +5 -5
@@ -200,8 +200,8 @@ static int vidioc_querycap(struct file *file, void *priv, {struct pcm20 *dev =video_drvdata (file); -strlcpy (v->driver,"Miro PCM20" ,sizeof (v->driver)); -strlcpy (v->card,"Miro PCM20" ,sizeof (v->card)); +strscpy (v->driver,"Miro PCM20" ,sizeof (v->driver)); +strscpy (v->card,"Miro PCM20" ,sizeof (v->card));snprintf (v->bus_info,sizeof (v->bus_info),"ISA:%s" , dev->v4l2_dev.name); v->device_caps =V4L2_CAP_TUNER |V4L2_CAP_RADIO |V4L2_CAP_RDS_CAPTURE ; v->capabilities = v->device_caps |V4L2_CAP_DEVICE_CAPS ;
@@ -231,7 +231,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,if (v->index)return -EINVAL ; -strlcpy (v->name,"FM" ,sizeof (v->name)); +strscpy (v->name,"FM" ,sizeof (v->name)); v->type =V4L2_TUNER_RADIO ; v->rangelow =87 *16000 ; v->rangehigh =108 *16000 ;
@@ -443,7 +443,7 @@ static int __init pcm20_init(void) "you must load the snd-miro driver first!\n");return -ENODEV ; } -strlcpy (v4l2_dev->name,"radio-miropcm20" ,sizeof (v4l2_dev->name)); +strscpy (v4l2_dev->name,"radio-miropcm20" ,sizeof (v4l2_dev->name));mutex_init (&dev->lock); res =v4l2_device_register (NULL , v4l2_dev);
@@ -474,7 +474,7 @@ static int __init pcm20_init(void)v4l2_err (v4l2_dev,"Could not register control\n" ); goto err_hdl; } -strlcpy (dev->vdev.name, v4l2_dev->name,sizeof (dev->vdev.name)); +strscpy (dev->vdev.name, v4l2_dev->name,sizeof (dev->vdev.name)); dev->vdev.v4l2_dev = v4l2_dev; dev->vdev.fops = &pcm20_fops; dev->vdev.ioctl_ops = &pcm20_ioctl_ops;
drivers/media/radio/radio-mr800.c +3 -3
@@ -266,8 +266,8 @@ static int vidioc_querycap(struct file *file, void *priv, {struct amradio_device *radio =video_drvdata (file); -strlcpy (v->driver,"radio-mr800" ,sizeof (v->driver)); -strlcpy (v->card,"AverMedia MR 800 USB FM Radio" ,sizeof (v->card)); +strscpy (v->driver,"radio-mr800" ,sizeof (v->driver)); +strscpy (v->card,"AverMedia MR 800 USB FM Radio" ,sizeof (v->card));usb_make_path (radio->usbdev, v->bus_info,sizeof (v->bus_info)); v->device_caps =V4L2_CAP_RADIO |V4L2_CAP_TUNER |V4L2_CAP_HW_FREQ_SEEK ;
@@ -547,7 +547,7 @@ static int usb_amradio_probe(struct usb_interface *intf, radio->v4l2_dev.ctrl_handler = &radio->hdl; radio->v4l2_dev.release = usb_amradio_release; -strlcpy (radio->vdev.name, radio->v4l2_dev.name, +strscpy (radio->vdev.name, radio->v4l2_dev.name,sizeof (radio->vdev.name)); radio->vdev.v4l2_dev = &radio->v4l2_dev; radio->vdev.fops = &usb_amradio_fops;
drivers/media/radio/radio-raremono.c +4 -4
@@ -181,8 +181,8 @@ static int vidioc_querycap(struct file *file, void *priv, {struct raremono_device *radio =video_drvdata (file); -strlcpy (v->driver,"radio-raremono" ,sizeof (v->driver)); -strlcpy (v->card,"Thanko's Raremono" ,sizeof (v->card)); +strscpy (v->driver,"radio-raremono" ,sizeof (v->driver)); +strscpy (v->card,"Thanko's Raremono" ,sizeof (v->card));usb_make_path (radio->usbdev, v->bus_info,sizeof (v->bus_info)); v->device_caps =V4L2_CAP_TUNER |V4L2_CAP_RADIO ; v->capabilities = v->device_caps |V4L2_CAP_DEVICE_CAPS ;
@@ -212,7 +212,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,if (v->index >0 )return -EINVAL ; -strlcpy (v->name,"AM/FM/SW" ,sizeof (v->name)); +strscpy (v->name,"AM/FM/SW" ,sizeof (v->name)); v->capability =V4L2_TUNER_CAP_LOW |V4L2_TUNER_CAP_STEREO |V4L2_TUNER_CAP_FREQ_BANDS ; v->rangelow =AM_FREQ_RANGE_LOW *16 ;
@@ -338,7 +338,7 @@ static int usb_raremono_probe(struct usb_interface *intf,mutex_init (&radio->lock); -strlcpy (radio->vdev.name, radio->v4l2_dev.name, +strscpy (radio->vdev.name, radio->v4l2_dev.name,sizeof (radio->vdev.name)); radio->vdev.v4l2_dev = &radio->v4l2_dev; radio->vdev.fops = &usb_raremono_fops;
drivers/media/radio/radio-sf16fmi.c +6 -6
@@ -129,9 +129,9 @@ static void fmi_set_freq(struct fmi *fmi)static int vidioc_querycap (struct file *file,void *priv,struct v4l2_capability *v) { -strlcpy (v->driver,"radio-sf16fmi" ,sizeof (v->driver)); -strlcpy (v->card,"SF16-FMI/FMP/FMD radio" ,sizeof (v->card)); -strlcpy (v->bus_info,"ISA:radio-sf16fmi" ,sizeof (v->bus_info)); +strscpy (v->driver,"radio-sf16fmi" ,sizeof (v->driver)); +strscpy (v->card,"SF16-FMI/FMP/FMD radio" ,sizeof (v->card)); +strscpy (v->bus_info,"ISA:radio-sf16fmi" ,sizeof (v->bus_info)); v->device_caps =V4L2_CAP_TUNER |V4L2_CAP_RADIO ; v->capabilities = v->device_caps |V4L2_CAP_DEVICE_CAPS ;return 0 ;
@@ -145,7 +145,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,if (v->index >0 )return -EINVAL ; -strlcpy (v->name,"FM" ,sizeof (v->name)); +strscpy (v->name,"FM" ,sizeof (v->name)); v->type =V4L2_TUNER_RADIO ; v->rangelow =RSF16_MINFREQ ; v->rangehigh =RSF16_MAXFREQ ;
@@ -315,7 +315,7 @@ static int __init fmi_init(void)return -ENODEV ; } -strlcpy (v4l2_dev->name,"sf16fmi" ,sizeof (v4l2_dev->name)); +strscpy (v4l2_dev->name,"sf16fmi" ,sizeof (v4l2_dev->name)); fmi->io = io; res =v4l2_device_register (NULL , v4l2_dev);
@@ -339,7 +339,7 @@ static int __init fmi_init(void)return res; } -strlcpy (fmi->vdev.name, v4l2_dev->name,sizeof (fmi->vdev.name)); +strscpy (fmi->vdev.name, v4l2_dev->name,sizeof (fmi->vdev.name)); fmi->vdev.v4l2_dev = v4l2_dev; fmi->vdev.fops = &fmi_fops; fmi->vdev.ioctl_ops = &fmi_ioctl_ops;
drivers/media/radio/radio-sf16fmr2.c +3 -3
@@ -213,8 +213,8 @@ static int fmr2_probe(struct fmr2 *fmr2, struct device *pdev, int io)if (io == fmr2_cards[i]->io)return -EBUSY ; -strlcpy (fmr2->v4l2_dev.name,"radio-sf16fmr2" , -sizeof (fmr2->v4l2_dev.name)), +strscpy (fmr2->v4l2_dev.name,"radio-sf16fmr2" , +sizeof (fmr2->v4l2_dev.name)), fmr2->io = io;if (!request_region (fmr2->io,2 , fmr2->v4l2_dev.name)) {
@@ -234,7 +234,7 @@ static int fmr2_probe(struct fmr2 *fmr2, struct device *pdev, int io) fmr2->tea.radio_nr = radio_nr[num_fmr2_cards]; fmr2->tea.ops = &fmr2_tea_ops; fmr2->tea.ext_init = fmr2_tea_ext_init; -strlcpy (fmr2->tea.card, card_name,sizeof (fmr2->tea.card)); +strscpy (fmr2->tea.card, card_name,sizeof (fmr2->tea.card));snprintf (fmr2->tea.bus_info,sizeof (fmr2->tea.bus_info),"%s:%s" , fmr2->is_fmd2 ?"PnP" :"ISA" ,dev_name (pdev));
drivers/media/radio/radio-shark.c +1 -1
@@ -345,7 +345,7 @@ static int usb_shark_probe(struct usb_interface *intf, shark->tea.ops = &shark_tea_ops; shark->tea.cannot_mute = true; shark->tea.has_am = true; -strlcpy (shark->tea.card,"Griffin radioSHARK" , +strscpy (shark->tea.card,"Griffin radioSHARK" ,sizeof (shark->tea.card));usb_make_path (shark->usbdev, shark->tea.bus_info,sizeof (shark->tea.bus_info));
drivers/media/radio/radio-shark2.c +1 -1
@@ -310,7 +310,7 @@ static int usb_shark_probe(struct usb_interface *intf, shark->tea.ops = &shark_tea_ops; shark->tea.has_am = true; shark->tea.write_before_read = true; -strlcpy (shark->tea.card,"Griffin radioSHARK2" , +strscpy (shark->tea.card,"Griffin radioSHARK2" ,sizeof (shark->tea.card));usb_make_path (shark->usbdev, shark->tea.bus_info,sizeof (shark->tea.bus_info));
drivers/media/radio/radio-si476x.c +6 -6
@@ -340,9 +340,9 @@ static int si476x_radio_querycap(struct file *file, void *priv, {struct si476x_radio *radio =video_drvdata (file); -strlcpy (capability->driver, radio->v4l2dev.name, +strscpy (capability->driver, radio->v4l2dev.name,sizeof (capability->driver)); -strlcpy (capability->card,DRIVER_CARD ,sizeof (capability->card)); +strscpy (capability->card,DRIVER_CARD ,sizeof (capability->card));snprintf (capability->bus_info,sizeof (capability->bus_info),"platform:%s" , radio->v4l2dev.name);
@@ -428,15 +428,15 @@ static int si476x_radio_g_tuner(struct file *file, void *priv,si476x_core_lock (radio->core);if (si476x_core_is_a_secondary_tuner (radio->core)) { -strlcpy (tuner->name,"FM (secondary)" ,sizeof (tuner->name)); +strscpy (tuner->name,"FM (secondary)" ,sizeof (tuner->name)); tuner->rxsubchans =0 ; tuner->rangelow = si476x_bands[SI476X_BAND_FM ].rangelow; }else if (si476x_core_has_am (radio->core)) {if (si476x_core_is_a_primary_tuner (radio->core)) -strlcpy (tuner->name,"AM/FM (primary)" , +strscpy (tuner->name,"AM/FM (primary)" ,sizeof (tuner->name));else -strlcpy (tuner->name,"AM/FM" ,sizeof (tuner->name)); +strscpy (tuner->name,"AM/FM" ,sizeof (tuner->name)); tuner->rxsubchans =V4L2_TUNER_SUB_MONO |V4L2_TUNER_SUB_STEREO |V4L2_TUNER_SUB_RDS ;
@@ -446,7 +446,7 @@ static int si476x_radio_g_tuner(struct file *file, void *priv, tuner->rangelow = si476x_bands[SI476X_BAND_AM ].rangelow; }else { -strlcpy (tuner->name,"FM" ,sizeof (tuner->name)); +strscpy (tuner->name,"FM" ,sizeof (tuner->name)); tuner->rxsubchans =V4L2_TUNER_SUB_RDS ; tuner->capability |=V4L2_TUNER_CAP_RDS |V4L2_TUNER_CAP_RDS_BLOCK_IO
drivers/media/radio/radio-tea5764.c +3 -3
@@ -287,8 +287,8 @@ static int vidioc_querycap(struct file *file, void *priv,struct tea5764_device *radio =video_drvdata (file);struct video_device *dev = &radio->vdev; -strlcpy (v->driver, dev->dev.driver->name,sizeof (v->driver)); -strlcpy (v->card, dev->name,sizeof (v->card)); +strscpy (v->driver, dev->dev.driver->name,sizeof (v->driver)); +strscpy (v->card, dev->name,sizeof (v->card));snprintf (v->bus_info,sizeof (v->bus_info),"I2C:%s" ,dev_name (&dev->dev)); v->device_caps =V4L2_CAP_TUNER |V4L2_CAP_RADIO ;
@@ -305,7 +305,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,if (v->index >0 )return -EINVAL ; -strlcpy (v->name,"FM" ,sizeof (v->name)); +strscpy (v->name,"FM" ,sizeof (v->name)); v->type =V4L2_TUNER_RADIO ;tea5764_i2c_read (radio); v->rangelow =FREQ_MIN *FREQ_MUL ;
drivers/media/radio/radio-tea5777.c +6 -6
@@ -266,10 +266,10 @@ static int vidioc_querycap(struct file *file, void *priv, {struct radio_tea5777 *tea =video_drvdata (file); -strlcpy (v->driver, tea->v4l2_dev->name,sizeof (v->driver)); -strlcpy (v->card, tea->card,sizeof (v->card)); +strscpy (v->driver, tea->v4l2_dev->name,sizeof (v->driver)); +strscpy (v->card, tea->card,sizeof (v->card));strlcat (v->card," TEA5777" ,sizeof (v->card)); -strlcpy (v->bus_info, tea->bus_info,sizeof (v->bus_info)); +strscpy (v->bus_info, tea->bus_info,sizeof (v->bus_info)); v->device_caps =V4L2_CAP_TUNER |V4L2_CAP_RADIO ; v->device_caps |=V4L2_CAP_HW_FREQ_SEEK ; v->capabilities = v->device_caps |V4L2_CAP_DEVICE_CAPS ;
@@ -304,9 +304,9 @@ static int vidioc_g_tuner(struct file *file, void *priv,memset (v,0 ,sizeof (*v));if (tea->has_am) -strlcpy (v->name,"AM/FM" ,sizeof (v->name)); +strscpy (v->name,"AM/FM" ,sizeof (v->name));else -strlcpy (v->name,"FM" ,sizeof (v->name)); +strscpy (v->name,"FM" ,sizeof (v->name)); v->type =V4L2_TUNER_RADIO ; v->capability =V4L2_TUNER_CAP_LOW |V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_FREQ_BANDS |
@@ -560,7 +560,7 @@ int radio_tea5777_init(struct radio_tea5777 *tea, struct module *owner) tea->vd = tea575x_radio;video_set_drvdata (&tea->vd, tea);mutex_init (&tea->mutex); -strlcpy (tea->vd.name, tea->v4l2_dev->name,sizeof (tea->vd.name)); +strscpy (tea->vd.name, tea->v4l2_dev->name,sizeof (tea->vd.name)); tea->vd.lock = &tea->mutex; tea->vd.v4l2_dev = tea->v4l2_dev; tea->fops = tea575x_fops;
drivers/media/radio/radio-timb.c +4 -4
@@ -39,8 +39,8 @@ struct timbradio {static int timbradio_vidioc_querycap (struct file *file,void *priv,struct v4l2_capability *v) { -strlcpy (v->driver,DRIVER_NAME ,sizeof (v->driver)); -strlcpy (v->card,"Timberdale Radio" ,sizeof (v->card)); +strscpy (v->driver,DRIVER_NAME ,sizeof (v->driver)); +strscpy (v->card,"Timberdale Radio" ,sizeof (v->card));snprintf (v->bus_info,sizeof (v->bus_info),"platform:" DRIVER_NAME ); v->device_caps =V4L2_CAP_TUNER |V4L2_CAP_RADIO ; v->capabilities = v->device_caps |V4L2_CAP_DEVICE_CAPS ;
@@ -115,7 +115,7 @@ static int timbradio_probe(struct platform_device *pdev) tr->pdata = *pdata;mutex_init (&tr->lock); -strlcpy (tr->video_dev.name,"Timberdale Radio" , +strscpy (tr->video_dev.name,"Timberdale Radio" ,sizeof (tr->video_dev.name)); tr->video_dev.fops = &timbradio_fops; tr->video_dev.ioctl_ops = &timbradio_ioctl_ops;
@@ -123,7 +123,7 @@ static int timbradio_probe(struct platform_device *pdev) tr->video_dev.minor =-1 ; tr->video_dev.lock = &tr->lock; -strlcpy (tr->v4l2_dev.name,DRIVER_NAME ,sizeof (tr->v4l2_dev.name)); +strscpy (tr->v4l2_dev.name,DRIVER_NAME ,sizeof (tr->v4l2_dev.name)); err =v4l2_device_register (NULL , &tr->v4l2_dev);if (err) goto err;
drivers/media/radio/radio-wl1273.c +6 -6
@@ -1286,11 +1286,11 @@ static int wl1273_fm_vidioc_querycap(struct file *file, void *priv,dev_dbg (radio->dev,"%s\n" , __func__); -strlcpy (capability->driver,WL1273_FM_DRIVER_NAME , +strscpy (capability->driver,WL1273_FM_DRIVER_NAME ,sizeof (capability->driver)); -strlcpy (capability->card,"Texas Instruments Wl1273 FM Radio" , +strscpy (capability->card,"Texas Instruments Wl1273 FM Radio" ,sizeof (capability->card)); -strlcpy (capability->bus_info, radio->bus_type, +strscpy (capability->bus_info, radio->bus_type,sizeof (capability->bus_info)); capability->device_caps = V4L2_CAP_HW_FREQ_SEEK |
@@ -1488,7 +1488,7 @@ static int wl1273_fm_vidioc_g_audio(struct file *file, void *priv,if (audio->index >1 )return -EINVAL ; -strlcpy (audio->name,"Radio" ,sizeof (audio->name)); +strscpy (audio->name,"Radio" ,sizeof (audio->name)); audio->capability =V4L2_AUDCAP_STEREO ;return 0 ;
@@ -1523,7 +1523,7 @@ static int wl1273_fm_vidioc_g_tuner(struct file *file, void *priv,if (tuner->index >0 )return -EINVAL ; -strlcpy (tuner->name,WL1273_FM_DRIVER_NAME ,sizeof (tuner->name)); +strscpy (tuner->name,WL1273_FM_DRIVER_NAME ,sizeof (tuner->name)); tuner->type =V4L2_TUNER_RADIO ; tuner->rangelow =WL1273_FREQ (WL1273_BAND_JAPAN_LOW );
@@ -1781,7 +1781,7 @@ static int wl1273_fm_vidioc_g_modulator(struct file *file, void *priv,dev_dbg (radio->dev,"%s\n" , __func__); -strlcpy (modulator->name,WL1273_FM_DRIVER_NAME , +strscpy (modulator->name,WL1273_FM_DRIVER_NAME ,sizeof (modulator->name)); modulator->rangelow =WL1273_FREQ (WL1273_BAND_JAPAN_LOW );
drivers/media/radio/si470x/radio-si470x-i2c.c +2 -2
@@ -229,8 +229,8 @@ static int si470x_fops_release(struct file *file)static int si470x_vidioc_querycap (struct file *file,void *priv,struct v4l2_capability *capability) { -strlcpy (capability->driver,DRIVER_NAME ,sizeof (capability->driver)); -strlcpy (capability->card,DRIVER_CARD ,sizeof (capability->card)); +strscpy (capability->driver,DRIVER_NAME ,sizeof (capability->driver)); +strscpy (capability->card,DRIVER_CARD ,sizeof (capability->card)); capability->device_caps =V4L2_CAP_HW_FREQ_SEEK |V4L2_CAP_READWRITE |V4L2_CAP_TUNER |V4L2_CAP_RADIO |V4L2_CAP_RDS_CAPTURE ; capability->capabilities = capability->device_caps |V4L2_CAP_DEVICE_CAPS ;
drivers/media/radio/si470x/radio-si470x-usb.c +2 -2
@@ -519,8 +519,8 @@ static int si470x_vidioc_querycap(struct file *file, void *priv, {struct si470x_device *radio =video_drvdata (file); -strlcpy (capability->driver,DRIVER_NAME ,sizeof (capability->driver)); -strlcpy (capability->card,DRIVER_CARD ,sizeof (capability->card)); +strscpy (capability->driver,DRIVER_NAME ,sizeof (capability->driver)); +strscpy (capability->card,DRIVER_CARD ,sizeof (capability->card));usb_make_path (radio->usbdev, capability->bus_info,sizeof (capability->bus_info)); capability->device_caps = V4L2_CAP_HW_FREQ_SEEK | V4L2_CAP_READWRITE |
drivers/media/radio/si4713/radio-platform-si4713.c +3 -3
@@ -67,10 +67,10 @@ static const struct v4l2_file_operations radio_si4713_fops = {static int radio_si4713_querycap (struct file *file,void *priv,struct v4l2_capability *capability) { -strlcpy (capability->driver,"radio-si4713" ,sizeof (capability->driver)); -strlcpy (capability->card,"Silicon Labs Si4713 Modulator" , +strscpy (capability->driver,"radio-si4713" ,sizeof (capability->driver)); +strscpy (capability->card,"Silicon Labs Si4713 Modulator" ,sizeof (capability->card)); -strlcpy (capability->bus_info,"platform:radio-si4713" , +strscpy (capability->bus_info,"platform:radio-si4713" ,sizeof (capability->bus_info)); capability->device_caps =V4L2_CAP_MODULATOR |V4L2_CAP_RDS_OUTPUT ; capability->capabilities = capability->device_caps |V4L2_CAP_DEVICE_CAPS ;
drivers/media/radio/si4713/radio-usb-si4713.c +3 -3
@@ -67,8 +67,8 @@ static int vidioc_querycap(struct file *file, void *priv, {struct si4713_usb_device *radio =video_drvdata (file); -strlcpy (v->driver,"radio-usb-si4713" ,sizeof (v->driver)); -strlcpy (v->card,"Si4713 FM Transmitter" ,sizeof (v->card)); +strscpy (v->driver,"radio-usb-si4713" ,sizeof (v->driver)); +strscpy (v->card,"Si4713 FM Transmitter" ,sizeof (v->card));usb_make_path (radio->usbdev, v->bus_info,sizeof (v->bus_info)); v->device_caps =V4L2_CAP_MODULATOR |V4L2_CAP_RDS_OUTPUT ; v->capabilities = v->device_caps |V4L2_CAP_DEVICE_CAPS ;
@@ -467,7 +467,7 @@ static int usb_si4713_probe(struct usb_interface *intf, radio->vdev.ctrl_handler = sd->ctrl_handler;
Lines of this file are not shown. View the raw message.
drivers/media/radio/wl128x/fmdrv_v4l2.c +5 -4
Lines of this file are not shown. View the raw message.
drivers/media/usb/au0828/au0828-video.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/media/usb/cx231xx/cx231xx-417.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/media/usb/cx231xx/cx231xx-input.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/media/usb/cx231xx/cx231xx-video.c +9 -9
Lines of this file are not shown. View the raw message.
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/media/usb/dvb-usb-v2/rtl28xxu.c +9 -9
Lines of this file are not shown. View the raw message.
drivers/media/usb/dvb-usb/dib0700_devices.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/media/usb/dvb-usb/dvb-usb-i2c.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/media/usb/dvb-usb/technisat-usb2.c +3 -2
Lines of this file are not shown. View the raw message.
drivers/media/usb/em28xx/em28xx-video.c +5 -5
Lines of this file are not shown. View the raw message.
drivers/media/usb/go7007/go7007-driver.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c +3 -3
Lines of this file are not shown. View the raw message.
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c +5 -5
Lines of this file are not shown. View the raw message.
drivers/media/usb/stk1160/stk1160-v4l.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/media/usb/tm6000/tm6000-video.c +4 -3
Lines of this file are not shown. View the raw message.
drivers/media/usb/usbvision/usbvision-video.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/media/v4l2-core/v4l2-flash-led-class.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/staging/media/bcm2048/radio-bcm2048.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/staging/media/davinci_vpfe/dm365_ipipe.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/staging/media/davinci_vpfe/dm365_ipipeif.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/staging/media/davinci_vpfe/dm365_isif.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/staging/media/davinci_vpfe/dm365_resizer.c +3 -3
Lines of this file are not shown. View the raw message.
drivers/staging/media/davinci_vpfe/vpfe_video.c +3 -3
Lines of this file are not shown. View the raw message.
drivers/staging/media/imx/imx-media-capture.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/staging/media/imx/imx-media-dev.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/staging/media/omap4iss/iss_ipipe.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/staging/media/omap4iss/iss_ipipeif.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/staging/media/omap4iss/iss_resizer.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/staging/media/omap4iss/iss_video.c +5 -5
Lines of this file are not shown. View the raw message.
drivers/staging/media/zoran/zoran_card.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/staging/media/zoran/zoran_driver.c +2 -2
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.17.1
Part of the diff is not shown here. View the raw message.
PATCH 3/3 media: replace strncpy() by strscpy()
In reply to Mauro Carvalho ChehabThe strncpy() function is being deprecated upstream. Replace it by the safer strscpy().
--- drivers/media/dvb-frontends/as102_fe.c | 2 +- drivers/media/dvb-frontends/dib7000p.c | 3 ++- drivers/media/dvb-frontends/dib8000.c | 4 ++-- drivers/media/dvb-frontends/dib9000.c | 6 ++++-- drivers/media/dvb-frontends/dvb-pll.c | 2 +- drivers/media/dvb-frontends/m88ds3103.c | 2 +- drivers/media/pci/bt8xx/dst.c | 3 ++- drivers/media/pci/mantis/mantis_i2c.c | 2 +- drivers/media/pci/saa7134/saa7134-go7007.c | 2 +- drivers/media/platform/am437x/am437x-vpfe.c | 2 +- drivers/media/platform/davinci/vpfe_capture.c | 2 +- drivers/media/platform/davinci/vpif_capture.c | 2 +- drivers/media/platform/davinci/vpif_display.c | 3 +-- drivers/media/platform/exynos4-is/fimc-capture.c | 2 +- drivers/media/platform/exynos4-is/fimc-m2m.c | 2 +- drivers/media/platform/mtk-vpu/mtk_vpu.c | 2 +- drivers/media/platform/mx2_emmaprp.c | 4 ++-- drivers/media/platform/s5p-g2d/g2d.c | 6 +++--- drivers/media/platform/ti-vpe/vpe.c | 6 +++--- drivers/media/platform/vicodec/vicodec-core.c | 4 ++-- drivers/media/platform/vim2m.c | 4 ++-- drivers/media/radio/si4713/si4713.c | 2 +- drivers/media/usb/go7007/go7007-usb.c | 16 ++++++++-------- drivers/media/usb/go7007/go7007-v4l2.c | 2 +- drivers/media/usb/hdpvr/hdpvr-video.c | 9 +++------ drivers/media/usb/pulse8-cec/pulse8-cec.c | 4 ++-- drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 2 +- drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 4 ++-- drivers/staging/media/bcm2048/radio-bcm2048.c | 4 ++-- drivers/staging/media/imx/imx-ic-common.c | 2 +- drivers/staging/media/imx/imx-media-vdic.c | 2 +- drivers/staging/media/zoran/zoran_driver.c | 10 +++++----- 32 files changed, 61 insertions(+), 61 deletions(-)
drivers/media/dvb-frontends/as102_fe.c +1 -1
@@ -467,7 +467,7 @@ struct dvb_frontend *as102_attach(const char *name,/* init frontend callback ops */ memcpy (&fe->ops, &as102_fe_ops,sizeof (struct dvb_frontend_ops )); -strncpy (fe->ops.info.name, name,sizeof (fe->ops.info.name)); +strscpy (fe->ops.info.name, name,sizeof (fe->ops.info.name));return fe;
drivers/media/dvb-frontends/dib7000p.c +2 -1
@@ -2771,7 +2771,8 @@ static struct dvb_frontend *dib7000p_init(struct i2c_adapter *i2c_adap, u8 i2c_adibx000_init_i2c_master (&st->i2c_master,DIB7000P , st->i2c_adap, st->i2c_addr);/* init 7090 tuner adapter */ -strncpy (st->dib7090_tuner_adap.name,"DiB7090 tuner interface" ,sizeof (st->dib7090_tuner_adap.name)); +strscpy (st->dib7090_tuner_adap.name,"DiB7090 tuner interface" , +sizeof (st->dib7090_tuner_adap.name)); st->dib7090_tuner_adap.algo = &dib7090_tuner_xfer_algo; st->dib7090_tuner_adap.algo_data =NULL ; st->dib7090_tuner_adap.dev.parent = st->i2c_adap->dev.parent;
drivers/media/dvb-frontends/dib8000.c +2 -2
@@ -4458,8 +4458,8 @@ static struct dvb_frontend *dib8000_init(struct i2c_adapter *i2c_adap, u8 i2c_addibx000_init_i2c_master (&state->i2c_master,DIB8000 , state->i2c.adap, state->i2c.addr);/* init 8096p tuner adapter */ -strncpy (state->dib8096p_tuner_adap.name,"DiB8096P tuner interface" , -sizeof (state->dib8096p_tuner_adap.name)); +strscpy (state->dib8096p_tuner_adap.name,"DiB8096P tuner interface" , +sizeof (state->dib8096p_tuner_adap.name)); state->dib8096p_tuner_adap.algo = &dib8096p_tuner_xfer_algo; state->dib8096p_tuner_adap.algo_data =NULL ; state->dib8096p_tuner_adap.dev.parent = state->i2c.adap->dev.parent;
drivers/media/dvb-frontends/dib9000.c +4 -2
@@ -2521,7 +2521,8 @@ struct dvb_frontend *dib9000_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, cdibx000_init_i2c_master (&st->i2c_master,DIB7000MC , st->i2c.i2c_adap, st->i2c.i2c_addr); st->tuner_adap.dev.parent = i2c_adap->dev.parent; -strncpy (st->tuner_adap.name,"DIB9000_FW TUNER ACCESS" ,sizeof (st->tuner_adap.name)); +strscpy (st->tuner_adap.name,"DIB9000_FW TUNER ACCESS" , +sizeof (st->tuner_adap.name)); st->tuner_adap.algo = &dib9000_tuner_algo; st->tuner_adap.algo_data =NULL ;i2c_set_adapdata (&st->tuner_adap, st);
@@ -2529,7 +2530,8 @@ struct dvb_frontend *dib9000_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, c goto error; st->component_bus.dev.parent = i2c_adap->dev.parent; -strncpy (st->component_bus.name,"DIB9000_FW COMPONENT BUS ACCESS" ,sizeof (st->component_bus.name)); +strscpy (st->component_bus.name,"DIB9000_FW COMPONENT BUS ACCESS" , +sizeof (st->component_bus.name)); st->component_bus.algo = &dib9000_component_bus_algo; st->component_bus.algo_data =NULL ; st->component_bus_speed =340 ;
drivers/media/dvb-frontends/dvb-pll.c +1 -1
@@ -843,7 +843,7 @@ struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr,memcpy (&fe->ops.tuner_ops, &dvb_pll_tuner_ops,sizeof (struct dvb_tuner_ops )); -strncpy (fe->ops.tuner_ops.info.name, desc->name, +strscpy (fe->ops.tuner_ops.info.name, desc->name,sizeof (fe->ops.tuner_ops.info.name));switch (c->delivery_system) {case SYS_DVBS :
drivers/media/dvb-frontends/m88ds3103.c +1 -1
@@ -1470,7 +1470,7 @@ static int m88ds3103_probe(struct i2c_client *client,/* create dvb_frontend */ memcpy (&dev->fe.ops, &m88ds3103_ops,sizeof (struct dvb_frontend_ops ));if (dev->chip_id ==M88RS6000_CHIP_ID ) -strncpy (dev->fe.ops.info.name,"Montage Technology M88RS6000" , +strscpy (dev->fe.ops.info.name,"Montage Technology M88RS6000" ,sizeof (dev->fe.ops.info.name));if (!pdata->attach_in_use) dev->fe.ops.release =NULL ;
drivers/media/pci/bt8xx/dst.c +2 -1
@@ -1100,7 +1100,8 @@ static int dst_get_device_id(struct dst_state *state)/* Card capabilities */ state->dst_hw_cap = p_dst_type->dst_feature;pr_err ("Recognise [%s]\n" , p_dst_type->device_id); -strncpy (&state->fw_name[0 ], p_dst_type->device_id,6 ); +strscpy ((char *)state->fw_name, p_dst_type->device_id, +sizeof (state->fw_name));/* Multiple tuners */ if (p_dst_type->tuner_type &TUNER_TYPE_MULTI ) {switch (use_dst_type) {
drivers/media/pci/mantis/mantis_i2c.c +1 -1
@@ -225,7 +225,7 @@ int mantis_i2c_init(struct mantis_pci *mantis)init_waitqueue_head (&mantis->i2c_wq);mutex_init (&mantis->i2c_lock); -strncpy (i2c_adapter->name,"Mantis I2C" ,sizeof (i2c_adapter->name)); +strscpy (i2c_adapter->name,"Mantis I2C" ,sizeof (i2c_adapter->name));i2c_set_adapdata (i2c_adapter, mantis); i2c_adapter->owner =THIS_MODULE ;
drivers/media/pci/saa7134/saa7134-go7007.c +1 -1
@@ -444,7 +444,7 @@ static int saa7134_go7007_init(struct saa7134_dev *dev) sd = &saa->sd;v4l2_subdev_init (sd, &saa7134_go7007_sd_ops);v4l2_set_subdevdata (sd, saa); -strncpy (sd->name,"saa7134-go7007" ,sizeof (sd->name)); +strscpy (sd->name,"saa7134-go7007" ,sizeof (sd->name));/* Allocate a couple pages for receiving the compressed stream */ saa->top = (u8 *)get_zeroed_page (GFP_KERNEL );
drivers/media/platform/am437x/am437x-vpfe.c +1 -1
@@ -1540,7 +1540,7 @@ static int vpfe_enum_fmt(struct file *file, void *priv,if (!fmt)return -EINVAL ; -strncpy (f->description, fmt->name,sizeof (f->description) -1 ); +strscpy (f->description, fmt->name,sizeof (f->description)); f->pixelformat = fmt->fourcc; f->type = vpfe->fmt.type;
drivers/media/platform/davinci/vpfe_capture.c +1 -1
@@ -1759,7 +1759,7 @@ static int vpfe_probe(struct platform_device *pdev)mutex_lock (&ccdc_lock); -strncpy (ccdc_cfg->name, vpfe_cfg->ccdc,32 ); +strscpy (ccdc_cfg->name, vpfe_cfg->ccdc,32 );/* Get VINT0 irq resource */ res1 =platform_get_resource (pdev,IORESOURCE_IRQ ,0 );if (!res1) {
drivers/media/platform/davinci/vpif_capture.c +1 -1
@@ -1254,7 +1254,7 @@ static int vpif_s_dv_timings(struct file *file, void *priv, }else { std_info->l5 = std_info->vsize - (bt->vfrontporch -1 ); } -strncpy (std_info->name,"Custom timings BT656/1120" ,VPIF_MAX_NAME ); +strscpy (std_info->name,"Custom timings BT656/1120" ,VPIF_MAX_NAME ); std_info->width = bt->width; std_info->height = bt->height; std_info->frm_fmt = bt->interlaced ?0 :1 ;
drivers/media/platform/davinci/vpif_display.c +1 -2
@@ -987,8 +987,7 @@ static int vpif_s_dv_timings(struct file *file, void *priv, }else { std_info->l5 = std_info->vsize - (bt->vfrontporch -1 ); } -strncpy (std_info->name,"Custom timings BT656/1120" , -VPIF_MAX_NAME ); +strscpy (std_info->name,"Custom timings BT656/1120" ,VPIF_MAX_NAME ); std_info->width = bt->width; std_info->height = bt->height; std_info->frm_fmt = bt->interlaced ?0 :1 ;
drivers/media/platform/exynos4-is/fimc-capture.c +1 -1
@@ -742,7 +742,7 @@ static int fimc_cap_enum_fmt_mplane(struct file *file, void *priv, f->index);if (!fmt)return -EINVAL ; -strncpy (f->description, fmt->name,sizeof (f->description) -1 ); +strscpy (f->description, fmt->name,sizeof (f->description)); f->pixelformat = fmt->fourcc;if (fmt->fourcc ==MEDIA_BUS_FMT_JPEG_1X8 ) f->flags |=V4L2_FMT_FLAG_COMPRESSED ;
drivers/media/platform/exynos4-is/fimc-m2m.c +1 -1
@@ -252,7 +252,7 @@ static int fimc_m2m_enum_fmt_mplane(struct file *file, void *priv,if (!fmt)return -EINVAL ; -strncpy (f->description, fmt->name,sizeof (f->description) -1 ); +strscpy (f->description, fmt->name,sizeof (f->description)); f->pixelformat = fmt->fourcc;return 0 ; }
drivers/media/platform/mtk-vpu/mtk_vpu.c +1 -1
@@ -615,7 +615,7 @@ static void vpu_init_ipi_handler(void *data, unsigned int len, void *priv)struct vpu_run *run = (struct vpu_run *)data; vpu->run.signaled = run->signaled; -strncpy (vpu->run.fw_ver, run->fw_ver,VPU_FW_VER_LEN ); +strscpy (vpu->run.fw_ver, run->fw_ver,VPU_FW_VER_LEN ); vpu->run.dec_capability = run->dec_capability; vpu->run.enc_capability = run->enc_capability;wake_up_interruptible (&vpu->run.wq);
drivers/media/platform/mx2_emmaprp.c +2 -2
@@ -385,8 +385,8 @@ static irqreturn_t emmaprp_irq(int irq_emma, void *data)static int vidioc_querycap (struct file *file,void *priv,struct v4l2_capability *cap) { -strncpy (cap->driver,MEM2MEM_NAME ,sizeof (cap->driver) -1 ); -strncpy (cap->card,MEM2MEM_NAME ,sizeof (cap->card) -1 ); +strscpy (cap->driver,MEM2MEM_NAME ,sizeof (cap->driver)); +strscpy (cap->card,MEM2MEM_NAME ,sizeof (cap->card)); cap->device_caps =V4L2_CAP_VIDEO_M2M |V4L2_CAP_STREAMING ; cap->capabilities = cap->device_caps |V4L2_CAP_DEVICE_CAPS ;return 0 ;
drivers/media/platform/s5p-g2d/g2d.c +3 -3
@@ -297,8 +297,8 @@ static int g2d_release(struct file *file)static int vidioc_querycap (struct file *file,void *priv,struct v4l2_capability *cap) { -strncpy (cap->driver,G2D_NAME ,sizeof (cap->driver) -1 ); -strncpy (cap->card,G2D_NAME ,sizeof (cap->card) -1 ); +strscpy (cap->driver,G2D_NAME ,sizeof (cap->driver)); +strscpy (cap->card,G2D_NAME ,sizeof (cap->card)); cap->bus_info[0 ] =0 ; cap->device_caps =V4L2_CAP_VIDEO_M2M |V4L2_CAP_STREAMING ; cap->capabilities = cap->device_caps |V4L2_CAP_DEVICE_CAPS ;
@@ -312,7 +312,7 @@ static int vidioc_enum_fmt(struct file *file, void *prv, struct v4l2_fmtdesc *f)return -EINVAL ; fmt = &formats[f->index]; f->pixelformat = fmt->fourcc; -strncpy (f->description, fmt->name,sizeof (f->description) -1 ); +strscpy (f->description, fmt->name,sizeof (f->description));return 0 ; }
drivers/media/platform/ti-vpe/vpe.c +3 -3
@@ -1491,8 +1491,8 @@ static irqreturn_t vpe_irq(int irq_vpe, void *data)static int vpe_querycap (struct file *file,void *priv,struct v4l2_capability *cap) { -strncpy (cap->driver,VPE_MODULE_NAME ,sizeof (cap->driver) -1 ); -strncpy (cap->card,VPE_MODULE_NAME ,sizeof (cap->card) -1 ); +strscpy (cap->driver,VPE_MODULE_NAME ,sizeof (cap->driver)); +strscpy (cap->card,VPE_MODULE_NAME ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" ,VPE_MODULE_NAME ); cap->device_caps =V4L2_CAP_VIDEO_M2M_MPLANE |V4L2_CAP_STREAMING ;
@@ -1519,7 +1519,7 @@ static int __enum_fmt(struct v4l2_fmtdesc *f, u32 type)if (!fmt)return -EINVAL ; -strncpy (f->description, fmt->name,sizeof (f->description) -1 ); +strscpy (f->description, fmt->name,sizeof (f->description)); f->pixelformat = fmt->fourcc;return 0 ; }
drivers/media/platform/vicodec/vicodec-core.c +2 -2
@@ -398,8 +398,8 @@ static const struct v4l2_fwht_pixfmt_info *find_fmt(u32 fmt)static int vidioc_querycap (struct file *file,void *priv,struct v4l2_capability *cap) { -strncpy (cap->driver,VICODEC_NAME ,sizeof (cap->driver) -1 ); -strncpy (cap->card,VICODEC_NAME ,sizeof (cap->card) -1 ); +strscpy (cap->driver,VICODEC_NAME ,sizeof (cap->driver)); +strscpy (cap->card,VICODEC_NAME ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" ,VICODEC_NAME ); cap->device_caps = V4L2_CAP_STREAMING |
drivers/media/platform/vim2m.c +2 -2
@@ -431,8 +431,8 @@ static void device_isr(struct timer_list *t)static int vidioc_querycap (struct file *file,void *priv,struct v4l2_capability *cap) { -strncpy (cap->driver,MEM2MEM_NAME ,sizeof (cap->driver) -1 ); -strncpy (cap->card,MEM2MEM_NAME ,sizeof (cap->card) -1 ); +strscpy (cap->driver,MEM2MEM_NAME ,sizeof (cap->driver)); +strscpy (cap->card,MEM2MEM_NAME ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" ,MEM2MEM_NAME ); cap->device_caps =V4L2_CAP_VIDEO_M2M |V4L2_CAP_STREAMING ;
drivers/media/radio/si4713/si4713.c +1 -1
@@ -1272,7 +1272,7 @@ static int si4713_g_modulator(struct v4l2_subdev *sd, struct v4l2_modulator *vm)if (vm->index >0 )return -EINVAL ; -strncpy (vm->name,"FM Modulator" ,32 ); +strscpy (vm->name,"FM Modulator" ,32 ); vm->capability =V4L2_TUNER_CAP_STEREO |V4L2_TUNER_CAP_LOW |V4L2_TUNER_CAP_RDS |V4L2_TUNER_CAP_RDS_CONTROLS ;
drivers/media/usb/go7007/go7007-usb.c +8 -8
@@ -1132,7 +1132,7 @@ static int go7007_usb_probe(struct usb_interface *intf, usb->usbdev = usbdev;usb_make_path (usbdev, go->bus_info,sizeof (go->bus_info)); go->board_id = id->driver_info; -strncpy (go->name, name,sizeof (go->name)); +strscpy (go->name, name,sizeof (go->name));if (board->flags &GO7007_USB_EZUSB ) go->hpi_ops = &go7007_usb_ezusb_hpi_ops;else
@@ -1198,7 +1198,7 @@ static int go7007_usb_probe(struct usb_interface *intf, go->board_id =GO7007_BOARDID_ENDURA ; usb->board = board = &board_endura; go->board_info = &board->main_info; -strncpy (go->name,"Pelco Endura" , +strscpy (go->name,"Pelco Endura" ,sizeof (go->name)); }else {u16 channel;
@@ -1232,21 +1232,21 @@ static int go7007_usb_probe(struct usb_interface *intf,case 1 : go->tuner_type =TUNER_SONY_BTF_PG472Z ; go->std =V4L2_STD_PAL ; -strncpy (go->name,"Plextor PX-TV402U-EU" , -sizeof (go->name)); +strscpy (go->name,"Plextor PX-TV402U-EU" , +sizeof (go->name));break ;case 2 : go->tuner_type =TUNER_SONY_BTF_PK467Z ; go->std =V4L2_STD_NTSC_M_JP ; num_i2c_devs -=2 ; -strncpy (go->name,"Plextor PX-TV402U-JP" , -sizeof (go->name)); +strscpy (go->name,"Plextor PX-TV402U-JP" , +sizeof (go->name));break ;case 3 : go->tuner_type =TUNER_SONY_BTF_PB463Z ; num_i2c_devs -=2 ; -strncpy (go->name,"Plextor PX-TV402U-NA" , -sizeof (go->name)); +strscpy (go->name,"Plextor PX-TV402U-NA" , +sizeof (go->name));break ;default :pr_debug ("unable to detect tuner type!\n" );
drivers/media/usb/go7007/go7007-v4l2.c +1 -1
@@ -327,7 +327,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, fmt->type =V4L2_BUF_TYPE_VIDEO_CAPTURE ; fmt->flags =V4L2_FMT_FLAG_COMPRESSED ; -strncpy (fmt->description, desc,sizeof (fmt->description)); +strscpy (fmt->description, desc,sizeof (fmt->description));return 0 ; }
drivers/media/usb/hdpvr/hdpvr-video.c +3 -6
@@ -769,8 +769,7 @@ static int vidioc_enum_input(struct file *file, void *_fh, struct v4l2_input *i) i->type =V4L2_INPUT_TYPE_CAMERA ; -strncpy (i->name, iname[n],sizeof (i->name) -1 ); - i->name[sizeof (i->name) -1 ] ='\0' ; +strscpy (i->name, iname[n],sizeof (i->name)); i->audioset =1 <<HDPVR_RCA_FRONT |1 <<HDPVR_RCA_BACK |1 <<HDPVR_SPDIF ;
@@ -841,8 +840,7 @@ static int vidioc_enumaudio(struct file *file, void *priv, audio->capability =V4L2_AUDCAP_STEREO ; -strncpy (audio->name, audio_iname[n],sizeof (audio->name) -1 ); - audio->name[sizeof (audio->name) -1 ] ='\0' ; +strscpy (audio->name, audio_iname[n],sizeof (audio->name));return 0 ; }
@@ -874,7 +872,6 @@ static int vidioc_g_audio(struct file *file, void *private_data, audio->index = dev->options.audio_input; audio->capability =V4L2_AUDCAP_STEREO ;strscpy (audio->name, audio_iname[audio->index],sizeof (audio->name)); - audio->name[sizeof (audio->name) -1 ] ='\0' ;return 0 ; }
@@ -991,7 +988,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *private_data,return -EINVAL ; f->flags =V4L2_FMT_FLAG_COMPRESSED ; -strncpy (f->description,"MPEG2-TS with AVC/AAC streams" ,32 ); +strscpy (f->description,"MPEG2-TS with AVC/AAC streams" ,32 ); f->pixelformat =V4L2_PIX_FMT_MPEG ;return 0 ;
drivers/media/usb/pulse8-cec/pulse8-cec.c +2 -2
@@ -435,7 +435,7 @@ static int pulse8_setup(struct pulse8 *pulse8, struct serio *serio, err =pulse8_send_and_wait (pulse8, cmd,1 , cmd[0 ],0 );if (err)return err; -strncpy (log_addrs->osd_name, data,13 ); +strscpy (log_addrs->osd_name, data,13 );dev_dbg (pulse8->dev,"OSD name: %s\n" , log_addrs->osd_name);return 0 ;
@@ -566,7 +566,7 @@ static int pulse8_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr)char *osd_str = cmd +1 ; cmd[0 ] =MSGCODE_SET_OSD_NAME ; -strncpy (cmd +1 , adap->log_addrs.osd_name,13 ); +strscpy (cmd +1 , adap->log_addrs.osd_name,13 );if (osd_len <4 ) {memset (osd_str + osd_len,' ' ,4 - osd_len); osd_len =4 ;
drivers/media/usb/pvrusb2/pvrusb2-hdw.c +1 -1
@@ -2459,7 +2459,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,if (!(qctrl.flags &V4L2_CTRL_FLAG_READ_ONLY )) { ciptr->set_value = ctrl_cx2341x_set; } -strncpy (hdw->mpeg_ctrl_info[idx].desc,qctrl.name, +strscpy (hdw->mpeg_ctrl_info[idx].desc, qctrl.name,PVR2_CTLD_INFO_DESC_SIZE ); hdw->mpeg_ctrl_info[idx].desc[PVR2_CTLD_INFO_DESC_SIZE -1 ] =0 ; ciptr->default_value = qctrl.default_value;
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c +2 -2
@@ -284,7 +284,7 @@ static int pvr2_enumaudio(struct file *file, void *priv, struct v4l2_audio *vin)if (vin->index >0 )return -EINVAL ; -strncpy (vin->name,"PVRUSB2 Audio" ,14 ); +strscpy (vin->name,"PVRUSB2 Audio" ,14 ); vin->capability =V4L2_AUDCAP_STEREO ;return 0 ; }
@@ -293,7 +293,7 @@ static int pvr2_g_audio(struct file *file, void *priv, struct v4l2_audio *vin) {/* pkt: FIXME: see above comment (VIDIOC_ENUMAUDIO) */ vin->index =0 ; -strncpy (vin->name,"PVRUSB2 Audio" ,14 ); +strscpy (vin->name,"PVRUSB2 Audio" ,14 ); vin->capability =V4L2_AUDCAP_STEREO ;return 0 ; }
drivers/staging/media/bcm2048/radio-bcm2048.c +2 -2
@@ -2403,7 +2403,7 @@ static int bcm2048_vidioc_g_audio(struct file *file, void *priv,if (audio->index >1 )return -EINVAL ; -strncpy (audio->name,"Radio" ,32 ); +strscpy (audio->name,"Radio" ,32 ); audio->capability =V4L2_AUDCAP_STEREO ;return 0 ;
@@ -2431,7 +2431,7 @@ static int bcm2048_vidioc_g_tuner(struct file *file, void *priv,if (tuner->index >0 )return -EINVAL ; -strncpy (tuner->name,"FM Receiver" ,32 ); +strscpy (tuner->name,"FM Receiver" ,32 ); tuner->type =V4L2_TUNER_RADIO ; tuner->rangelow =dev_to_v4l2 (bcm2048_get_region_bottom_frequency (bdev));
drivers/staging/media/imx/imx-ic-common.c +1 -1
@@ -63,7 +63,7 @@ static int imx_ic_probe(struct platform_device *pdev) priv->sd.owner =THIS_MODULE ; priv->sd.flags =V4L2_SUBDEV_FL_HAS_DEVNODE |V4L2_SUBDEV_FL_HAS_EVENTS ; priv->sd.grp_id = pdata->grp_id; -strncpy (priv->sd.name, pdata->sd_name,sizeof (priv->sd.name)); +strscpy (priv->sd.name, pdata->sd_name,sizeof (priv->sd.name)); ret = ic_ops[priv->task_id]->init (priv);if (ret)
drivers/staging/media/imx/imx-media-vdic.c +1 -1
@@ -963,7 +963,7 @@ static int imx_vdic_probe(struct platform_device *pdev) priv->sd.flags =V4L2_SUBDEV_FL_HAS_DEVNODE ;/* get our group id */ priv->sd.grp_id = pdata->grp_id; -strncpy (priv->sd.name, pdata->sd_name,sizeof (priv->sd.name)); +strscpy (priv->sd.name, pdata->sd_name,sizeof (priv->sd.name));mutex_init (&priv->lock);
drivers/staging/media/zoran/zoran_driver.c +5 -5
@@ -1526,8 +1526,8 @@ static int zoran_enum_fmt(struct zoran *zr, struct v4l2_fmtdesc *fmt, int flag)for (num = i =0 ; i <NUM_FORMATS ; i++) {if (zoran_formats[i].flags & flag && num++ == fmt->index) { -strncpy (fmt->description, zoran_formats[i].name, -sizeof (fmt->description) -1 ); +strscpy (fmt->description, zoran_formats[i].name, +sizeof (fmt->description));/* fmt struct pre-zeroed, so adding '\0' not needed */ fmt->pixelformat = zoran_formats[i].fourcc;if (zoran_formats[i].flags &ZORAN_FORMAT_COMPRESSED )
@@ -2301,8 +2301,8 @@ static int zoran_enum_input(struct file *file, void *__fh,if (inp->index >= zr->card.inputs)return -EINVAL ; -strncpy (inp->name, zr->card.input[inp->index].name, -sizeof (inp->name) -1 ); +strscpy (inp->name, zr->card.input[inp->index].name, +sizeof (inp->name)); inp->type =V4L2_INPUT_TYPE_CAMERA ; inp->std =V4L2_STD_ALL ;
@@ -2344,7 +2344,7 @@ static int zoran_enum_output(struct file *file, void *__fh, outp->index =0 ; outp->type =V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY ; -strncpy (outp->name,"Autodetect" ,sizeof (outp->name)-1 ); +strscpy (outp->name,"Autodetect" ,sizeof (outp->name));return 0 ; }
Signature · 1 line
2.17.1
Re: [PATCH 1/3] media: use strscpy() instead of strlcpy()
In reply to Mauro Carvalho ChehabQuoted 3 lines · Mauro Carvalho Chehab
The implementation of
strscpy()is more robust and safer.That's now the recommended way to copy NUL terminated strings.
This looks fine since I don't see anything using the strlcpy() return value (the return value meaning between strlcpy() and strscpy() differs).
-Kees
Signature · 2 lines
Kees Cook Pixel Security
Re: [PATCH 2/3] media: replace strcpy() by strscpy()
In reply to Mauro Carvalho ChehabQuoted 2 lines · Mauro Carvalho Chehab
The
strcpy()function is being deprecated upstream. Replace it by the saferstrscpy().
Did you verify that all the destination buffers here are arrays and not pointers? For example:
struct thing {
char buffer[64];
char *ptr;
}
strscpy(instance->buffer, source, sizeof(instance->buffer));
is correct.
But:
strscpy(instance->ptr, source, sizeof(instance->ptr));
will not be and will truncate strings to sizeof(char *).
If you _did_ verify this, I'd love to know more about your tooling. :)
-Kees
Signature · 2 lines
Kees Cook Pixel Security
Re: [PATCH 3/3] media: replace strncpy() by strscpy()
In reply to Mauro Carvalho ChehabQuoted 2 lines · Mauro Carvalho Chehab
The
strncpy()function is being deprecated upstream. Replace it by the saferstrscpy().
This one I'm quite concerned about. This could lead to kernel memory exposures if any of the callers depend on strncpy()'s trailing NUL-padding to clear a buffer of prior contents.
How did you validate that for these changes?
-Kees
Signature · 2 lines
Kees Cook Pixel Security
Re: [PATCH 3/3] media: replace strncpy() by strscpy()
Em Mon, 10 Sep 2018 09:18:05 -0700
Kees Cook <[email protected]> escreveu:
Quoted 10 lines
Quoted 2 lines · Mauro Carvalho Chehab
The
strncpy()function is being deprecated upstream. Replace it by the saferstrscpy().This one I'm quite concerned about. This could lead to kernel memory exposures if any of the callers depend on strncpy()'s trailing NUL-padding to clear a buffer of prior contents.
How did you validate that for these changes?
That's actually easy for those familiar with the V4L2 API. There are several fields at either uAPI or kAPI (or both) that have strings.
For example, a video input has a name.
So, for one familiar with the V4L2 API, it is clear that something like:
+ strscpy(inp->name, zr->card.input[inp->index].name,
+ sizeof(inp->name));
Is just filling the uAPI with the name of Input, with is, typically, something like:
S-Video
Television
Radio
Composite
A visual inspection of the patch shows that, on almost all cases, it is either filling a device driver's name (used mainly for debug routines), a video Input, a format description string, or the video caps fields name and driver.
Thanks,
Mauro
Re: [PATCH 2/3] media: replace strcpy() by strscpy()
In reply to Kees CookEm Mon, 10 Sep 2018 09:16:35 -0700
Kees Cook <[email protected]> escreveu:
Quoted 17 lines
Quoted 2 lines · Mauro Carvalho Chehab
The
strcpy()function is being deprecated upstream. Replace it by the saferstrscpy().Did you verify that all the destination buffers here are arrays and not pointers? For example:
struct thing {
char buffer[64];
char *ptr;
}
strscpy(instance->buffer, source, sizeof(instance->buffer));is correct.
Quoted 7 lines
But:
strscpy(instance->ptr, source, sizeof(instance->ptr));will not be and will truncate strings to
sizeof(char *).If you _did_ verify this, I'd love to know more about your tooling. :)
I ended by implementing a simple tooling to test... it found just one place where it was wrong. I'll send the correct patch.
The tooling is actually a hack... see enclosed.
Basically, it defines a __strscpy() that will try to create a negative array if the size is equal to a pointer size.
Then, I replaced all occurrences of strscpy with __strcpy() with:
$ for i in $(git grep -l strscpy drivers/media drivers/staging/media); do sed s,strscpy,__strscpy,g -i $i; done
and compiled on 32 bits (that's my usual build). As all strings at the media API are bigger than 4 bytes, it will only complain if it tries to do a sizeof(*).
Thanks,
Mauro
TEST hack
include/linux/string.h +9 -0
@@ -66,6 +66,15 @@ extern char * strrchr(const char *,int);#endif extern char *__must_check skip_spaces (const char *); + +#define __strscpy (origin, dest, size) \ +({ \ + char zzz[1 - 2*(size == sizeof(char *))]; \ + zzz[0] = 1; \ + if (zzz[0] >2) zzz[0]++; \ + strscpy(origin, dest, size); \ +}) +extern char *strim (char *);static inline __must_check char *strstrip (char *str)
Re: [PATCH 2/3] media: replace strcpy() by strscpy()
Em Mon, 10 Sep 2018 16:48:47 -0300
Mauro Carvalho Chehab <[email protected]> escreveu:
Quoted 22 lines
Em Mon, 10 Sep 2018 09:16:35 -0700
Kees Cook <[email protected]> escreveu:Quoted 19 lines
Quoted 2 lines · Mauro Carvalho Chehab
The
strcpy()function is being deprecated upstream. Replace it by the saferstrscpy().Did you verify that all the destination buffers here are arrays and not pointers? For example:
struct thing {
char buffer[64];
char *ptr;
}
strscpy(instance->buffer, source, sizeof(instance->buffer));is correct.
But:
Quoted 8 lines
Quoted 5 lines
strscpy(instance->ptr, source, sizeof(instance->ptr));will not be and will truncate strings to
sizeof(char *).If you _did_ verify this, I'd love to know more about your tooling. :)
I ended by implementing a simple tooling to test... it found just one place where it was wrong. I'll send the correct patch.
Btw, at the only case it was trying to fill a pointer was for some sysfs fill. AFAIKT, the buffer size there is PAGE_SIZE, so, I guess the enclosed patch would be the right way to use strscpy().
Yet, IMHO, a better fix would be if the parameters for DEVICE_ATTR store field would have a count.
Thanks,
Mauro
drivers/media/rc/imon.c +2 -2
@@ -772,9 +772,9 @@ static ssize_t show_associate_remote(struct device *d,mutex_lock (&ictx->lock);if (ictx->rf_isassociating) -strcpy (buf,"associating\n" ); +strscpy (buf,"associating\n" ,PAGE_SIZE );else -strcpy (buf,"closed\n" ); +strscpy (buf,"closed\n" ,PAGE_SIZE );dev_info (d,"Visit http://www.lirc.org/html/imon-24g.html for instructions on how to associate your iMON 2.4G DT/LT remote\n" );mutex_unlock (&ictx->lock);
PATCH v2 2/3 media: replace strcpy() by strscpy()
The strcpy() function is being deprecated upstream. Replace it by the safer strscpy().
--
v2: removed the changes at the imon driver. There, the is a debugfs node with a store function using DEVICE_ATTR() passing a char * buf without any sizing information.
So, for now, keep using strcpy() there.
drivers/media/common/saa7146/saa7146_video.c +1 -1
@@ -451,7 +451,7 @@ static int vidioc_querycap(struct file *file, void *fh, struct v4l2_capability *struct video_device *vdev =video_devdata (file);struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -strcpy ((char *)cap->driver,"saa7146 v4l2" ); +strscpy ((char *)cap->driver,"saa7146 v4l2" ,sizeof (cap->driver));strscpy ((char *)cap->card, dev->ext->name,sizeof (cap->card));sprintf ((char *)cap->bus_info,"PCI:%s" ,pci_name (dev->pci)); cap->device_caps =
drivers/media/dvb-core/dvb_frontend.c +1 -1
@@ -2422,7 +2422,7 @@ static int dvb_frontend_handle_ioctl(struct file *file,struct dvb_frontend_info *info = parg;memset (info,0 ,sizeof (*info)); -strcpy (info->name, fe->ops.info.name); +strscpy (info->name, fe->ops.info.name,sizeof (info->name)); info->symbol_rate_min = fe->ops.info.symbol_rate_min; info->symbol_rate_max = fe->ops.info.symbol_rate_max; info->symbol_rate_tolerance = fe->ops.info.symbol_rate_tolerance;
drivers/media/dvb-frontends/mt312.c +6 -3
@@ -815,17 +815,20 @@ struct dvb_frontend *mt312_attach(const struct mt312_config *config,switch (state->id) {case ID_VP310 : -strcpy (state->frontend.ops.info.name,"Zarlink VP310 DVB-S" ); +strscpy (state->frontend.ops.info.name,"Zarlink VP310 DVB-S" , +sizeof (state->frontend.ops.info.name)); state->xtal =MT312_PLL_CLK ; state->freq_mult =9 ;break ;case ID_MT312 : -strcpy (state->frontend.ops.info.name,"Zarlink MT312 DVB-S" ); +strscpy (state->frontend.ops.info.name,"Zarlink MT312 DVB-S" , +sizeof (state->frontend.ops.info.name)); state->xtal =MT312_PLL_CLK ; state->freq_mult =6 ;break ;case ID_ZL10313 : -strcpy (state->frontend.ops.info.name,"Zarlink ZL10313 DVB-S" ); +strscpy (state->frontend.ops.info.name,"Zarlink ZL10313 DVB-S" , +sizeof (state->frontend.ops.info.name)); state->xtal =MT312_PLL_CLK_10_111 ; state->freq_mult =9 ;break ;
drivers/media/dvb-frontends/zl10039.c +3 -2
@@ -288,8 +288,9 @@ struct dvb_frontend *zl10039_attach(struct dvb_frontend *fe, state->id = state->id &0x0f ;switch (state->id) {case ID_ZL10039 : -strcpy (fe->ops.tuner_ops.info.name, -"Zarlink ZL10039 DVB-S tuner" ); +strscpy (fe->ops.tuner_ops.info.name, +"Zarlink ZL10039 DVB-S tuner" , +sizeof (fe->ops.tuner_ops.info.name));break ;default :dprintk ("Chip ID=%x does not match a known type\n" , state->id);
drivers/media/firewire/firedtv-fe.c +1 -1
@@ -247,7 +247,7 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name)dev_err (fdtv->device,"no frontend for model type %d\n" , fdtv->type); } -strcpy (fi->name, name); +strscpy (fi->name, name,sizeof (fi->name)); fdtv->fe.dvb = &fdtv->adapter; fdtv->fe.sec_priv = fdtv;
drivers/media/i2c/ad5820.c +1 -1
@@ -317,7 +317,7 @@ static int ad5820_probe(struct i2c_client *client,v4l2_i2c_subdev_init (&coil->subdev, client, &ad5820_ops); coil->subdev.flags |=V4L2_SUBDEV_FL_HAS_DEVNODE ; coil->subdev.internal_ops = &ad5820_internal_ops; -strcpy (coil->subdev.name,"ad5820 focus" ); +strscpy (coil->subdev.name,"ad5820 focus" ,sizeof (coil->subdev.name)); ret =media_entity_pads_init (&coil->subdev.entity,0 ,NULL );if (ret <0 )
drivers/media/i2c/lm3560.c +2 -1
@@ -362,7 +362,8 @@ static int lm3560_subdev_init(struct lm3560_flash *flash,v4l2_i2c_subdev_init (&flash->subdev_led[led_no], client, &lm3560_ops); flash->subdev_led[led_no].flags |=V4L2_SUBDEV_FL_HAS_DEVNODE ; -strcpy (flash->subdev_led[led_no].name, led_name); +strscpy (flash->subdev_led[led_no].name, led_name, +sizeof (flash->subdev_led[led_no].name)); rval =lm3560_init_controls (flash, led_no);if (rval) goto err_out;
drivers/media/i2c/lm3646.c +2 -1
@@ -278,7 +278,8 @@ static int lm3646_subdev_init(struct lm3646_flash *flash)v4l2_i2c_subdev_init (&flash->subdev_led, client, &lm3646_ops); flash->subdev_led.flags |=V4L2_SUBDEV_FL_HAS_DEVNODE ; -strcpy (flash->subdev_led.name,LM3646_NAME ); +strscpy (flash->subdev_led.name,LM3646_NAME , +sizeof (flash->subdev_led.name)); rval =lm3646_init_controls (flash);if (rval) goto err_out;
drivers/media/i2c/s5c73m3/s5c73m3-core.c +1 -1
@@ -1698,7 +1698,7 @@ static int s5c73m3_probe(struct i2c_client *client,return ret;v4l2_i2c_subdev_init (oif_sd, client, &oif_subdev_ops); -strcpy (oif_sd->name,"S5C73M3-OIF" ); +strscpy (oif_sd->name,"S5C73M3-OIF" ,sizeof (oif_sd->name)); oif_sd->internal_ops = &oif_internal_ops; oif_sd->flags |=V4L2_SUBDEV_FL_HAS_DEVNODE ;
drivers/media/i2c/sr030pc30.c +1 -1
@@ -703,7 +703,7 @@ static int sr030pc30_probe(struct i2c_client *client,return -ENOMEM ; sd = &info->sd; -strcpy (sd->name,MODULE_NAME ); +strscpy (sd->name,MODULE_NAME ,sizeof (sd->name)); info->pdata = client->dev.platform_data;v4l2_i2c_subdev_init (sd, client, &sr030pc30_ops);
drivers/media/pci/bt8xx/bttv-driver.c +2 -2
@@ -2782,7 +2782,7 @@ static int bttv_g_tuner(struct file *file, void *priv, t->rxsubchans =V4L2_TUNER_SUB_MONO ; t->capability =V4L2_TUNER_CAP_NORM ;bttv_call_all (btv, tuner, g_tuner, t); -strcpy (t->name,"Television" ); +strscpy (t->name,"Television" ,sizeof (t->name)); t->type =V4L2_TUNER_ANALOG_TV ;if (btread (BT848_DSTATUS )&BT848_DSTATUS_HLOC ) t->signal =0xffff ;
@@ -3257,7 +3257,7 @@ static int radio_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)if (0 != t->index)return -EINVAL ; -strcpy (t->name,"Radio" ); +strscpy (t->name,"Radio" ,sizeof (t->name)); t->type =V4L2_TUNER_RADIO ;radio_enable (btv);
drivers/media/pci/cx23885/cx23885-417.c +1 -1
@@ -1280,7 +1280,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,return -EINVAL ;if (0 != t->index)return -EINVAL ; -strcpy (t->name,"Television" ); +strscpy (t->name,"Television" ,sizeof (t->name));call_all (dev, tuner, g_tuner, t);dprintk (1 ,"VIDIOC_G_TUNER: tuner type %d\n" , t->type);
drivers/media/pci/cx23885/cx23885-alsa.c +2 -2
@@ -526,7 +526,7 @@ static int snd_cx23885_pcm(struct cx23885_audio_dev *chip, int device,if (err <0 )return err; pcm->private_data = chip; -strcpy (pcm->name, name); +strscpy (pcm->name, name,sizeof (pcm->name));snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_cx23885_pcm_ops);return 0 ;
@@ -571,7 +571,7 @@ struct cx23885_audio_dev *cx23885_audio_register(struct cx23885_dev *dev)if (err <0 ) goto error; -strcpy (card->driver,"CX23885" ); +strscpy (card->driver,"CX23885" ,sizeof (card->driver));sprintf (card->shortname,"Conexant CX23885" );sprintf (card->longname,"%s at %s" , card->shortname, dev->name);
drivers/media/pci/cx23885/cx23885-video.c +6 -5
@@ -639,7 +639,7 @@ static int vidioc_querycap(struct file *file, void *priv,struct cx23885_dev *dev =video_drvdata (file);struct video_device *vdev =video_devdata (file); -strcpy (cap->driver,"cx23885" ); +strscpy (cap->driver,"cx23885" ,sizeof (cap->driver));strscpy (cap->card, cx23885_boards[dev->board].name,sizeof (cap->card));sprintf (cap->bus_info,"PCIe:%s" ,pci_name (dev->pci));
@@ -731,7 +731,7 @@ int cx23885_enum_input(struct cx23885_dev *dev, struct v4l2_input *i) 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)); i->std =CX23885_NORMS ;if ((CX23885_VMUX_TELEVISION ==INPUT (n)->type) || (CX23885_VMUX_CABLE ==INPUT (n)->type)) {
@@ -828,7 +828,7 @@ static int cx23885_query_audinput(struct file *file, void *priv,memset (i,0 ,sizeof (*i)); i->index = n; -strcpy (i->name, iname[n]); +strscpy (i->name, iname[n],sizeof (i->name)); i->capability =V4L2_AUDCAP_STEREO ;return 0 ;
@@ -887,7 +887,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));call_all (dev, tuner, g_tuner, t);return 0 ;
@@ -1186,7 +1186,8 @@ int cx23885_video_register(struct cx23885_dev *dev)/* Initialize VBI template */ cx23885_vbi_template = cx23885_video_template; -strcpy (cx23885_vbi_template.name,"cx23885-vbi" ); +strscpy (cx23885_vbi_template.name,"cx23885-vbi" , +sizeof (cx23885_vbi_template.name)); dev->tvnorm =V4L2_STD_NTSC_M ; dev->fmt =format_by_fourcc (V4L2_PIX_FMT_YUYV );
drivers/media/pci/cx25821/cx25821-alsa.c +4 -4
@@ -674,7 +674,7 @@ static int snd_cx25821_pcm(struct cx25821_audio_dev *chip, int device, } pcm->private_data = chip; pcm->info_flags =0 ; -strcpy (pcm->name, name); +strscpy (pcm->name, name,sizeof (pcm->name));snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_cx25821_pcm_ops);return 0 ;
@@ -725,7 +725,7 @@ static int cx25821_audio_initdev(struct cx25821_dev *dev)return err; } -strcpy (card->driver,"cx25821" ); +strscpy (card->driver,"cx25821" ,sizeof (card->driver));/* Card "creation" */ chip = card->private_data;
@@ -754,10 +754,10 @@ static int cx25821_audio_initdev(struct cx25821_dev *dev) goto error; } -strcpy (card->shortname,"cx25821" ); +strscpy (card->shortname,"cx25821" ,sizeof (card->shortname));sprintf (card->longname,"%s at 0x%lx irq %d" , chip->dev->name, chip->iobase, chip->irq); -strcpy (card->mixername,"CX25821" ); +strscpy (card->mixername,"CX25821" ,sizeof (card->mixername));pr_info ("%s/%i: ALSA support for cx25821 boards\n" , card->driver, devno);
drivers/media/pci/cx25821/cx25821-video.c +3 -3
@@ -441,7 +441,7 @@ static int cx25821_vidioc_querycap(struct file *file, void *priv,V4L2_CAP_READWRITE |V4L2_CAP_STREAMING ;const u32 cap_output =V4L2_CAP_VIDEO_OUTPUT |V4L2_CAP_READWRITE ; -strcpy (cap->driver,"cx25821" ); +strscpy (cap->driver,"cx25821" ,sizeof (cap->driver));strscpy (cap->card, cx25821_boards[dev->board].name,sizeof (cap->card));sprintf (cap->bus_info,"PCIe:%s" ,pci_name (dev->pci));if (chan->id >=VID_CHANNEL_NUM )
@@ -486,7 +486,7 @@ static int cx25821_vidioc_enum_input(struct file *file, void *priv, i->type =V4L2_INPUT_TYPE_CAMERA ; i->std =CX25821_NORMS ; -strcpy (i->name,"Composite" ); +strscpy (i->name,"Composite" ,sizeof (i->name));return 0 ; }
@@ -534,7 +534,7 @@ static int cx25821_vidioc_enum_output(struct file *file, void *priv, o->type =V4L2_INPUT_TYPE_CAMERA ; o->std =CX25821_NORMS ; -strcpy (o->name,"Composite" ); +strscpy (o->name,"Composite" ,sizeof (o->name));return 0 ; }
drivers/media/pci/cx88/cx88-alsa.c +3 -3
@@ -616,7 +616,7 @@ static int snd_cx88_pcm(struct cx88_audio_dev *chip, int device,if (err <0 )return err; pcm->private_data = chip; -strcpy (pcm->name, name); +strscpy (pcm->name, name,sizeof (pcm->name));snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_cx88_pcm_ops);return 0 ;
@@ -968,12 +968,12 @@ static int cx88_audio_initdev(struct pci_dev *pci, goto error; } -strcpy (card->driver,"CX88x" ); +strscpy (card->driver,"CX88x" ,sizeof (card->driver));sprintf (card->shortname,"Conexant CX%x" , pci->device);sprintf (card->longname,"%s at %#llx" , card->shortname, (unsigned long long )pci_resource_start (pci,0 )); -strcpy (card->mixername,"CX88" ); +strscpy (card->mixername,"CX88" ,sizeof (card->mixername));dprintk (0 ,"%s/%i: ALSA support for cx2388x boards\n" , card->driver, devno);
drivers/media/pci/cx88/cx88-blackbird.c +2 -2
@@ -803,7 +803,7 @@ static int vidioc_querycap(struct file *file, void *priv,struct cx8802_dev *dev =video_drvdata (file);struct cx88_core *core = dev->core; -strcpy (cap->driver,"cx88_blackbird" ); +strscpy (cap->driver,"cx88_blackbird" ,sizeof (cap->driver));sprintf (cap->bus_info,"PCI:%s" ,pci_name (dev->pci));return cx88_querycap (file, core, cap); }
@@ -995,7 +995,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,if (t->index !=0 )return -EINVAL ; -strcpy (t->name,"Television" ); +strscpy (t->name,"Television" ,sizeof (t->name)); t->capability =V4L2_TUNER_CAP_NORM ; t->rangehigh =0xffffffffUL ;call_all (core, tuner, g_tuner, t);
drivers/media/pci/cx88/cx88-cards.c +1 -1
@@ -3693,7 +3693,7 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr) core->height =240 ; core->field =V4L2_FIELD_INTERLACED ; -strcpy (core->v4l2_dev.name, core->name); +strscpy (core->v4l2_dev.name, core->name,sizeof (core->v4l2_dev.name));if (v4l2_device_register (NULL , &core->v4l2_dev)) {kfree (core);return NULL ;
drivers/media/pci/cx88/cx88-video.c +4 -4
@@ -842,7 +842,7 @@ static int vidioc_querycap(struct file *file, void *priv,struct cx8800_dev *dev =video_drvdata (file);struct cx88_core *core = dev->core; -strcpy (cap->driver,"cx8800" ); +strscpy (cap->driver,"cx8800" ,sizeof (cap->driver));sprintf (cap->bus_info,"PCI:%s" ,pci_name (dev->pci));return cx88_querycap (file, core, cap); }
@@ -897,7 +897,7 @@ int cx88_enum_input(struct cx88_core *core, struct v4l2_input *i)if (!INPUT (n).type)return -EINVAL ; 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 ==CX88_VMUX_TELEVISION ) || (INPUT (n).type ==CX88_VMUX_CABLE )) i->type =V4L2_INPUT_TYPE_TUNER ;
@@ -952,7 +952,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,if (t->index !=0 )return -EINVAL ; -strcpy (t->name,"Television" ); +strscpy (t->name,"Television" ,sizeof (t->name)); t->capability =V4L2_TUNER_CAP_NORM ; t->rangehigh =0xffffffffUL ;call_all (core, tuner, g_tuner, t);
@@ -1065,7 +1065,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));call_all (core, tuner, g_tuner, t);return 0 ;
drivers/media/pci/dm1105/dm1105.c +3 -2
@@ -1046,7 +1046,7 @@ static int dm1105_probe(struct pci_dev *pdev,/* i2c */ i2c_set_adapdata (&dev->i2c_adap, dev); -strcpy (dev->i2c_adap.name,DRIVER_NAME ); +strscpy (dev->i2c_adap.name,DRIVER_NAME ,sizeof (dev->i2c_adap.name)); dev->i2c_adap.owner =THIS_MODULE ; dev->i2c_adap.dev.parent = &pdev->dev; dev->i2c_adap.algo = &dm1105_algo;
@@ -1057,7 +1057,8 @@ static int dm1105_probe(struct pci_dev *pdev, goto err_dm1105_hw_exit;i2c_set_adapdata (&dev->i2c_bb_adap, dev); -strcpy (dev->i2c_bb_adap.name,DM1105_I2C_GPIO_NAME ); +strscpy (dev->i2c_bb_adap.name,DM1105_I2C_GPIO_NAME , +sizeof (dev->i2c_bb_adap.name)); dev->i2c_bb_adap.owner =THIS_MODULE ; dev->i2c_bb_adap.dev.parent = &pdev->dev; dev->i2c_bb_adap.algo_data = &dev->i2c_bit;
drivers/media/pci/dt3155/dt3155.c +3 -3
@@ -307,8 +307,8 @@ static int dt3155_querycap(struct file *filp, void *p, {struct dt3155_priv *pd =video_drvdata (filp); -strcpy (cap->driver,DT3155_NAME ); -strcpy (cap->card,DT3155_NAME " frame grabber" ); +strscpy (cap->driver,DT3155_NAME ,sizeof (cap->driver)); +strscpy (cap->card,DT3155_NAME " frame grabber" ,sizeof (cap->card));sprintf (cap->bus_info,"PCI:%s" ,pci_name (pd->pdev)); cap->device_caps =V4L2_CAP_VIDEO_CAPTURE |V4L2_CAP_STREAMING |V4L2_CAP_READWRITE ;
@@ -322,7 +322,7 @@ static int dt3155_enum_fmt_vid_cap(struct file *filp,if (f->index)return -EINVAL ; f->pixelformat =V4L2_PIX_FMT_GREY ; -strcpy (f->description,"8-bit Greyscale" ); +strscpy (f->description,"8-bit Greyscale" ,sizeof (f->description));return 0 ; }
drivers/media/pci/meye/meye.c +5 -5
@@ -1019,8 +1019,8 @@ static int meyeioc_stilljcapt(int *len)static int vidioc_querycap (struct file *file,void *fh,struct v4l2_capability *cap) { -strcpy (cap->driver,"meye" ); -strcpy (cap->card,"meye" ); +strscpy (cap->driver,"meye" ,sizeof (cap->driver)); +strscpy (cap->card,"meye" ,sizeof (cap->card));sprintf (cap->bus_info,"PCI:%s" ,pci_name (meye.mchip_dev)); cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
@@ -1035,7 +1035,7 @@ static int vidioc_enum_input(struct file *file, void *fh, struct v4l2_input *i)if (i->index !=0 )return -EINVAL ; -strcpy (i->name,"Camera" ); +strscpy (i->name,"Camera" ,sizeof (i->name)); i->type =V4L2_INPUT_TYPE_CAMERA ;return 0 ;
@@ -1118,12 +1118,12 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *fh,if (f->index ==0 ) {/* standard YUV 422 capture */ f->flags =0 ; -strcpy (f->description,"YUV422" ); +strscpy (f->description,"YUV422" ,sizeof (f->description)); f->pixelformat =V4L2_PIX_FMT_YUYV ; }else {/* compressed MJPEG capture */ f->flags =V4L2_FMT_FLAG_COMPRESSED ; -strcpy (f->description,"MJPEG" ); +strscpy (f->description,"MJPEG" ,sizeof (f->description)); f->pixelformat =V4L2_PIX_FMT_MJPEG ; }
drivers/media/pci/ngene/ngene-i2c.c +1 -1
@@ -161,7 +161,7 @@ int ngene_i2c_init(struct ngene *dev, int dev_nr)i2c_set_adapdata (adap, &(dev->channel[dev_nr])); -strcpy (adap->name,"nGene" ); +strscpy (adap->name,"nGene" ,sizeof (adap->name)); adap->algo = &ngene_i2c_algo; adap->algo_data = (void *)&(dev->channel[dev_nr]);
drivers/media/pci/pluto2/pluto2.c +1 -1
@@ -633,7 +633,7 @@ static int pluto2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)/* i2c */ i2c_set_adapdata (&pluto->i2c_adap, pluto); -strcpy (pluto->i2c_adap.name,DRIVER_NAME ); +strscpy (pluto->i2c_adap.name,DRIVER_NAME ,sizeof (pluto->i2c_adap.name)); pluto->i2c_adap.owner =THIS_MODULE ; pluto->i2c_adap.dev.parent = &pdev->dev; pluto->i2c_adap.algo_data = &pluto->i2c_bit;
drivers/media/pci/pt1/pt1.c +1 -1
@@ -1354,7 +1354,7 @@ static int pt1_probe(struct pci_dev *pdev, const struct pci_device_id *ent) i2c_adap->algo = &pt1_i2c_algo; i2c_adap->algo_data =NULL ; i2c_adap->dev.parent = &pdev->dev; -strcpy (i2c_adap->name,DRIVER_NAME ); +strscpy (i2c_adap->name,DRIVER_NAME ,sizeof (i2c_adap->name));i2c_set_adapdata (i2c_adap, pt1); ret =i2c_add_adapter (i2c_adap);if (ret <0 )
drivers/media/pci/saa7134/saa7134-alsa.c +4 -4
@@ -901,7 +901,7 @@ static int snd_card_saa7134_pcm(snd_card_saa7134_t *saa7134, int device)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_card_saa7134_capture_ops); pcm->private_data = saa7134; pcm->info_flags =0 ; -strcpy (pcm->name,"SAA7134 PCM" ); +strscpy (pcm->name,"SAA7134 PCM" ,sizeof (pcm->name));return 0 ; }
@@ -1074,7 +1074,7 @@ static int snd_card_saa7134_new_mixer(snd_card_saa7134_t * chip)unsigned int idx;int err, addr; -strcpy (card->mixername,"SAA7134 Mixer" ); +strscpy (card->mixername,"SAA7134 Mixer" ,sizeof (card->mixername));for (idx =0 ; idx <ARRAY_SIZE (snd_saa7134_volume_controls); idx++) { kcontrol = snd_ctl_new1(&snd_saa7134_volume_controls[idx],
@@ -1138,7 +1138,7 @@ static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum)if (err <0 )return err; -strcpy (card->driver,"SAA7134" ); +strscpy (card->driver,"SAA7134" ,sizeof (card->driver));/* Card "creation" */
@@ -1178,7 +1178,7 @@ static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum)/* End of "creation" */ -strcpy (card->shortname,"SAA7134" ); +strscpy (card->shortname,"SAA7134" ,sizeof (card->shortname));sprintf (card->longname,"%s at 0x%lx irq %d" , chip->dev->name, chip->iobase, chip->irq);
drivers/media/pci/saa7134/saa7134-i2c.c +1 -1
@@ -437,7 +437,7 @@ int saa7134_i2c_register(struct saa7134_dev *dev) { dev->i2c_adap = saa7134_adap_template; dev->i2c_adap.dev.parent = &dev->pci->dev; -strcpy (dev->i2c_adap.name,dev->name); +strscpy (dev->i2c_adap.name,dev->name,sizeof (dev->i2c_adap.name)); dev->i2c_adap.algo_data = dev;i2c_set_adapdata (&dev->i2c_adap, &dev->v4l2_dev);i2c_add_adapter (&dev->i2c_adap);
drivers/media/pci/saa7134/saa7134-video.c +5 -4
@@ -1445,7 +1445,8 @@ int saa7134_enum_input(struct file *file, void *priv, struct v4l2_input *i)if (card_in (dev, i->index).type ==SAA7134_NO_INPUT )return -EINVAL ; i->index = n; -strcpy (i->name, saa7134_input_name[card_in (dev, n).type]); +strscpy (i->name, saa7134_input_name[card_in (dev, n).type], +sizeof (i->name));switch (card_in (dev, n).type) {case SAA7134_INPUT_TV :case SAA7134_INPUT_TV_MONO :
@@ -1502,7 +1503,7 @@ int saa7134_querycap(struct file *file, void *priv,unsigned int tuner_type = dev->tuner_type; -strcpy (cap->driver,"saa7134" ); +strscpy (cap->driver,"saa7134" ,sizeof (cap->driver));strscpy (cap->card, saa7134_boards[dev->board].name,sizeof (cap->card));sprintf (cap->bus_info,"PCI:%s" ,pci_name (dev->pci));
@@ -1747,7 +1748,7 @@ int saa7134_g_tuner(struct file *file, void *priv,if (n ==SAA7134_INPUT_MAX )return -EINVAL ;if (card_in (dev, n).type !=SAA7134_NO_INPUT ) { -strcpy (t->name,"Television" ); +strscpy (t->name,"Television" ,sizeof (t->name)); t->type =V4L2_TUNER_ANALOG_TV ;saa_call_all (dev, tuner, g_tuner, t); t->capability = V4L2_TUNER_CAP_NORM |
@@ -1939,7 +1940,7 @@ static int radio_g_tuner(struct file *file, void *priv,if (0 != t->index)return -EINVAL ; -strcpy (t->name,"Radio" ); +strscpy (t->name,"Radio" ,sizeof (t->name));saa_call_all (dev, tuner, g_tuner, t); t->audmode &=V4L2_TUNER_MODE_MONO |V4L2_TUNER_MODE_STEREO ;
drivers/media/pci/saa7164/saa7164-core.c +1 -1
@@ -179,7 +179,7 @@ static void saa7164_histogram_reset(struct saa7164_histogram *hg, char *name)int i;memset (hg,0 ,sizeof (struct saa7164_histogram )); -strcpy (hg->name, name); +strscpy (hg->name, name,sizeof (hg->name));/* First 30ms x 1ms */ for (i =0 ; i <30 ; i++)
drivers/media/pci/saa7164/saa7164-encoder.c +3 -3
@@ -258,7 +258,7 @@ int saa7164_enum_input(struct file *file, void *priv, struct v4l2_input *i)if (i->index >=7 )return -EINVAL ; -strcpy (i->name, inputs[i->index]); +strscpy (i->name, inputs[i->index],sizeof (i->name));if (i->index ==0 ) i->type =V4L2_INPUT_TYPE_TUNER ;
@@ -325,7 +325,7 @@ int saa7164_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->capability =V4L2_TUNER_CAP_NORM |V4L2_TUNER_CAP_STEREO ; t->rangelow =SAA7164_TV_MIN_FREQ ; t->rangehigh =SAA7164_TV_MAX_FREQ ;
@@ -497,7 +497,7 @@ static int vidioc_querycap(struct file *file, void *priv,struct saa7164_port *port = fh->port;struct saa7164_dev *dev = port->dev; -strcpy (cap->driver, dev->name); +strscpy (cap->driver, dev->name,sizeof (cap->driver));strscpy (cap->card, saa7164_boards[dev->board].name,sizeof (cap->card));sprintf (cap->bus_info,"PCI:%s" ,pci_name (dev->pci));
drivers/media/pci/saa7164/saa7164-vbi.c +1 -1
@@ -208,7 +208,7 @@ static int vidioc_querycap(struct file *file, void *priv,struct saa7164_port *port = fh->port;struct saa7164_dev *dev = port->dev; -strcpy (cap->driver, dev->name); +strscpy (cap->driver, dev->name,sizeof (cap->driver));strscpy (cap->card, saa7164_boards[dev->board].name,sizeof (cap->card));sprintf (cap->bus_info,"PCI:%s" ,pci_name (dev->pci));
drivers/media/pci/smipcie/smipcie-main.c +2 -2
@@ -191,7 +191,7 @@ static int smi_i2c_init(struct smi_dev *dev)/* i2c bus 0 */ smi_i2c_cfg (dev,I2C_A_SW_CTL );i2c_set_adapdata (&dev->i2c_bus[0 ], dev); -strcpy (dev->i2c_bus[0 ].name,"SMI-I2C0" ); +strscpy (dev->i2c_bus[0 ].name,"SMI-I2C0" ,sizeof (dev->i2c_bus[0 ].name)); dev->i2c_bus[0 ].owner =THIS_MODULE ; dev->i2c_bus[0 ].dev.parent = &dev->pci_dev->dev; dev->i2c_bus[0 ].algo_data = &dev->i2c_bit[0 ];
@@ -213,7 +213,7 @@ static int smi_i2c_init(struct smi_dev *dev)/* i2c bus 1 */ smi_i2c_cfg (dev,I2C_B_SW_CTL );i2c_set_adapdata (&dev->i2c_bus[1 ], dev); -strcpy (dev->i2c_bus[1 ].name,"SMI-I2C1" ); +strscpy (dev->i2c_bus[1 ].name,"SMI-I2C1" ,sizeof (dev->i2c_bus[1 ].name)); dev->i2c_bus[1 ].owner =THIS_MODULE ; dev->i2c_bus[1 ].dev.parent = &dev->pci_dev->dev; dev->i2c_bus[1 ].algo_data = &dev->i2c_bit[1 ];
drivers/media/pci/solo6x10/solo6x10-g723.c +4 -4
@@ -354,7 +354,7 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)snd_pcm_chip (pcm) = solo_dev; pcm->info_flags =0 ; -strcpy (pcm->name, card->shortname); +strscpy (pcm->name, card->shortname,sizeof (pcm->name));for (i =0 , ss = pcm->streams[SNDRV_PCM_STREAM_CAPTURE ].substream; ss; ss = ss->next, i++)
@@ -394,8 +394,8 @@ int solo_g723_init(struct solo_dev *solo_dev) card = solo_dev->snd_card; -strcpy (card->driver,SOLO6X10_NAME ); -strcpy (card->shortname,"SOLO-6x10 Audio" ); +strscpy (card->driver,SOLO6X10_NAME ,sizeof (card->driver)); +strscpy (card->shortname,"SOLO-6x10 Audio" ,sizeof (card->shortname));sprintf (card->longname,"%s on %s IRQ %d" , card->shortname,pci_name (solo_dev->pdev), solo_dev->pdev->irq);
@@ -404,7 +404,7 @@ int solo_g723_init(struct solo_dev *solo_dev) goto snd_error;/* Mixer controls */ -strcpy (card->mixername,"SOLO-6x10" ); +strscpy (card->mixername,"SOLO-6x10" ,sizeof (card->mixername)); kctl = snd_solo_capture_volume; kctl.count = solo_dev->nr_chans;
drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c +7 -5
@@ -775,7 +775,7 @@ static int solo_enc_querycap(struct file *file, void *priv,struct solo_enc_dev *solo_enc =video_drvdata (file);struct solo_dev *solo_dev = solo_enc->solo_dev; -strcpy (cap->driver,SOLO6X10_NAME ); +strscpy (cap->driver,SOLO6X10_NAME ,sizeof (cap->driver));snprintf (cap->card,sizeof (cap->card),"Softlogic 6x10 Enc %d" , solo_enc->ch); snprintf(cap->bus_info, sizeof(cap->bus_info), "PCI:%s",
@@ -834,17 +834,18 @@ static int solo_enc_enum_fmt_cap(struct file *file, void *priv,switch (dev_type) {case SOLO_DEV_6010 : f->pixelformat =V4L2_PIX_FMT_MPEG4 ; -strcpy (f->description,"MPEG-4 part 2" ); +strscpy (f->description,"MPEG-4 part 2" , +sizeof (f->description));break ;case SOLO_DEV_6110 : f->pixelformat =V4L2_PIX_FMT_H264 ; -strcpy (f->description,"H.264" ); +strscpy (f->description,"H.264" ,sizeof (f->description));break ; }break ;case 1 : f->pixelformat =V4L2_PIX_FMT_MJPEG ; -strcpy (f->description,"MJPEG" ); +strscpy (f->description,"MJPEG" ,sizeof (f->description));break ;default :return -EINVAL ;
@@ -1126,7 +1127,8 @@ static int solo_s_ctrl(struct v4l2_ctrl *ctrl) solo_enc->md_thresholds->p_new.p_u16);break ;case V4L2_CID_OSD_TEXT : -strcpy (solo_enc->osd_text, ctrl->p_new.p_char); +strscpy (solo_enc->osd_text, ctrl->p_new.p_char, +sizeof (solo_enc->osd_text));return solo_osd_print (solo_enc);default :return -EINVAL ;
drivers/media/pci/solo6x10/solo6x10-v4l2.c +2 -2
@@ -383,8 +383,8 @@ static int solo_querycap(struct file *file, void *priv, {struct solo_dev *solo_dev =video_drvdata (file); -strcpy (cap->driver,SOLO6X10_NAME ); -strcpy (cap->card,"Softlogic 6x10" ); +strscpy (cap->driver,SOLO6X10_NAME ,sizeof (cap->driver)); +strscpy (cap->card,"Softlogic 6x10" ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"PCI:%s" ,pci_name (solo_dev->pdev)); cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
drivers/media/pci/sta2x11/sta2x11_vip.c +3 -3
@@ -419,8 +419,8 @@ static int vidioc_querycap(struct file *file, void *priv, {struct sta2x11_vip *vip =video_drvdata (file); -strcpy (cap->driver,KBUILD_MODNAME ); -strcpy (cap->card,KBUILD_MODNAME ); +strscpy (cap->driver,KBUILD_MODNAME ,sizeof (cap->driver)); +strscpy (cap->card,KBUILD_MODNAME ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"PCI:%s" ,pci_name (vip->pdev)); cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
@@ -580,7 +580,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,if (f->index !=0 )return -EINVAL ; -strcpy (f->description,"4:2:2, packed, UYVY" ); +strscpy (f->description,"4:2:2, packed, UYVY" ,sizeof (f->description)); f->pixelformat =V4L2_PIX_FMT_UYVY ; f->flags =0 ;return 0 ;
drivers/media/pci/ttpci/av7110_v4l.c +1 -1
@@ -332,7 +332,7 @@ static int vidioc_g_tuner(struct file *file, void *fh, struct v4l2_tuner *t)return -EINVAL ;memset (t,0 ,sizeof (*t)); -strcpy ((char *)t->name,"Television" ); +strscpy ((char *)t->name,"Television" ,sizeof (t->name)); t->type =V4L2_TUNER_ANALOG_TV ; t->capability = V4L2_TUNER_CAP_NORM | V4L2_TUNER_CAP_STEREO |
drivers/media/pci/ttpci/budget-core.c +4 -2
@@ -504,10 +504,12 @@ int ttpci_budget_init(struct budget *budget, struct saa7146_dev *dev,if (bi->type !=BUDGET_FS_ACTIVY )saa7146_write (dev,GPIO_CTRL ,0x500000 );/* GPIO 3 = 1 */ -strscpy (budget->i2c_adap.name, budget->card->name,sizeof (budget->i2c_adap.name)); +strscpy (budget->i2c_adap.name, budget->card->name, +sizeof (budget->i2c_adap.name));saa7146_i2c_adapter_prepare (dev, &budget->i2c_adap,SAA7146_I2C_BUS_BIT_RATE_120 ); -strcpy (budget->i2c_adap.name, budget->card->name); +strscpy (budget->i2c_adap.name, budget->card->name, +sizeof (budget->i2c_adap.name));if (i2c_add_adapter (&budget->i2c_adap) <0 ) { ret = -ENOMEM ;
drivers/media/pci/tw5864/tw5864-video.c +1 -1
@@ -610,7 +610,7 @@ static int tw5864_querycap(struct file *file, void *priv, {struct tw5864_input *input =video_drvdata (file); -strcpy (cap->driver,"tw5864" ); +strscpy (cap->driver,"tw5864" ,sizeof (cap->driver));snprintf (cap->card,sizeof (cap->card),"TW5864 Encoder %d" , input->nr);sprintf (cap->bus_info,"PCI:%s" ,pci_name (input->root->pci));
drivers/media/pci/tw68/tw68-video.c +1 -1
@@ -734,7 +734,7 @@ static int tw68_querycap(struct file *file, void *priv, {struct tw68_dev *dev =video_drvdata (file); -strcpy (cap->driver,"tw68" ); +strscpy (cap->driver,"tw68" ,sizeof (cap->driver));strscpy (cap->card,"Techwell Capture Card" ,sizeof (cap->card));sprintf (cap->bus_info,"PCI:%s" ,pci_name (dev->pci));
drivers/media/platform/am437x/am437x-vpfe.c +2 -1
@@ -2455,7 +2455,8 @@ vpfe_get_pdata(struct platform_device *pdev)/* we only support camera */ sdinfo->inputs[0 ].index = i; -strcpy (sdinfo->inputs[0 ].name,"Camera" ); +strscpy (sdinfo->inputs[0 ].name,"Camera" , +sizeof (sdinfo->inputs[0 ].name)); sdinfo->inputs[0 ].type =V4L2_INPUT_TYPE_CAMERA ; sdinfo->inputs[0 ].std =V4L2_STD_ALL ; sdinfo->inputs[0 ].capabilities =V4L2_IN_CAP_STD ;
drivers/media/platform/atmel/atmel-isc.c +3 -3
@@ -1238,8 +1238,8 @@ static int isc_querycap(struct file *file, void *priv, {struct isc_device *isc =video_drvdata (file); -strcpy (cap->driver,ATMEL_ISC_NAME ); -strcpy (cap->card,"Atmel Image Sensor Controller" ); +strscpy (cap->driver,ATMEL_ISC_NAME ,sizeof (cap->driver)); +strscpy (cap->card,"Atmel Image Sensor Controller" ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" , isc->v4l2_dev.name);
@@ -1393,7 +1393,7 @@ static int isc_enum_input(struct file *file, void *priv, inp->type =V4L2_INPUT_TYPE_CAMERA ; inp->std =0 ; -strcpy (inp->name,"Camera" ); +strscpy (inp->name,"Camera" ,sizeof (inp->name));return 0 ; }
drivers/media/platform/davinci/vpbe_display.c +4 -2
@@ -816,10 +816,12 @@ static int vpbe_display_enum_fmt(struct file *file, void *priv, fmt->index = index; fmt->type =V4L2_BUF_TYPE_VIDEO_OUTPUT ;if (index ==0 ) { -strcpy (fmt->description,"YUV 4:2:2 - UYVY" ); +strscpy (fmt->description,"YUV 4:2:2 - UYVY" , +sizeof (fmt->description)); fmt->pixelformat =V4L2_PIX_FMT_UYVY ; }else { -strcpy (fmt->description,"Y/CbCr 4:2:0" ); +strscpy (fmt->description,"Y/CbCr 4:2:0" , +sizeof (fmt->description)); fmt->pixelformat =V4L2_PIX_FMT_NV12 ; }
drivers/media/platform/davinci/vpbe_venc.c +1 -1
@@ -616,7 +616,7 @@ struct v4l2_subdev *venc_sub_dev_init(struct v4l2_device *v4l2_dev,v4l2_subdev_init (&venc->sd, &venc_ops); -strcpy (venc->sd.name, venc_name); +strscpy (venc->sd.name, venc_name,sizeof (venc->sd.name));if (v4l2_device_register_subdev (v4l2_dev, &venc->sd) <0 ) {v4l2_err (v4l2_dev,"vpbe unable to register venc sub device\n" );
drivers/media/platform/davinci/vpif_capture.c +4 -2
@@ -949,11 +949,13 @@ static int vpif_enum_fmt_vid_cap(struct file *file, void *priv,/* Fill in the information about format */ if (ch->vpifparams.iface.if_type ==VPIF_IF_RAW_BAYER ) { fmt->type =V4L2_BUF_TYPE_VIDEO_CAPTURE ; -strcpy (fmt->description,"Raw Mode -Bayer Pattern GrRBGb" ); +strscpy (fmt->description,"Raw Mode -Bayer Pattern GrRBGb" , +sizeof (fmt->description)); fmt->pixelformat =V4L2_PIX_FMT_SBGGR8 ; }else { fmt->type =V4L2_BUF_TYPE_VIDEO_CAPTURE ; -strcpy (fmt->description,"YCbCr4:2:2 Semi-Planar" ); +strscpy (fmt->description,"YCbCr4:2:2 Semi-Planar" , +sizeof (fmt->description)); fmt->pixelformat =V4L2_PIX_FMT_NV16 ; }return 0 ;
drivers/media/platform/davinci/vpif_display.c +2 -1
@@ -602,7 +602,8 @@ static int vpif_enum_fmt_vid_out(struct file *file, void *priv,/* Fill in the information about format */ fmt->type =V4L2_BUF_TYPE_VIDEO_OUTPUT ; -strcpy (fmt->description,"YCbCr4:2:2 YC Planar" ); +strscpy (fmt->description,"YCbCr4:2:2 YC Planar" , +sizeof (fmt->description)); fmt->pixelformat =V4L2_PIX_FMT_YUV422P ; fmt->flags =0 ;return 0 ;
drivers/media/platform/fsl-viu.c +4 -4
@@ -565,9 +565,9 @@ static const struct videobuf_queue_ops viu_video_qops = {static int vidioc_querycap (struct file *file,void *priv,struct v4l2_capability *cap) { -strcpy (cap->driver,"viu" ); -strcpy (cap->card,"viu" ); -strcpy (cap->bus_info,"platform:viu" ); +strscpy (cap->driver,"viu" ,sizeof (cap->driver)); +strscpy (cap->card,"viu" ,sizeof (cap->card)); +strscpy (cap->bus_info,"platform:viu" ,sizeof (cap->bus_info)); cap->device_caps =V4L2_CAP_VIDEO_CAPTURE |V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_OVERLAY |
@@ -941,7 +941,7 @@ static int vidioc_enum_input(struct file *file, void *priv, inp->type =V4L2_INPUT_TYPE_CAMERA ; inp->std = fh->dev->vdev->tvnorms; -strcpy (inp->name,"Camera" ); +strscpy (inp->name,"Camera" ,sizeof (inp->name));return 0 ; }
drivers/media/platform/marvell-ccic/cafe-driver.c +1 -1
@@ -341,7 +341,7 @@ static int cafe_smbus_setup(struct cafe_camera *cam)return -ENOMEM ; adap->owner =THIS_MODULE ; adap->algo = &cafe_smbus_algo; -strcpy (adap->name,"cafe_ccic" ); +strscpy (adap->name,"cafe_ccic" ,sizeof (adap->name)); adap->dev.parent = &cam->pdev->dev;i2c_set_adapdata (adap, cam); ret =i2c_add_adapter (adap);
drivers/media/platform/marvell-ccic/mcam-core.c +3 -3
@@ -1303,8 +1303,8 @@ static int mcam_vidioc_querycap(struct file *file, void *priv, {struct mcam_camera *cam =video_drvdata (file); -strcpy (cap->driver,"marvell_ccic" ); -strcpy (cap->card,"marvell_ccic" ); +strscpy (cap->driver,"marvell_ccic" ,sizeof (cap->driver)); +strscpy (cap->card,"marvell_ccic" ,sizeof (cap->card));strscpy (cap->bus_info, cam->bus_info,sizeof (cap->bus_info)); cap->device_caps =V4L2_CAP_VIDEO_CAPTURE |V4L2_CAP_READWRITE |V4L2_CAP_STREAMING ;
@@ -1421,7 +1421,7 @@ static int mcam_vidioc_enum_input(struct file *filp, void *priv,return -EINVAL ; input->type =V4L2_INPUT_TYPE_CAMERA ; -strcpy (input->name,"Camera" ); +strscpy (input->name,"Camera" ,sizeof (input->name));return 0 ; }
drivers/media/platform/soc_camera/soc_camera.c +1 -1
@@ -312,7 +312,7 @@ static int soc_camera_enum_input(struct file *file, void *priv,/* default is camera */ inp->type =V4L2_INPUT_TYPE_CAMERA ; inp->std = icd->vdev->tvnorms; -strcpy (inp->name,"Camera" ); +strscpy (inp->name,"Camera" ,sizeof (inp->name));return 0 ; }
drivers/media/platform/via-camera.c +3 -3
@@ -812,7 +812,7 @@ static int viacam_enum_input(struct file *filp, void *priv, input->type =V4L2_INPUT_TYPE_CAMERA ; input->std =V4L2_STD_ALL ;/* Not sure what should go here */ -strcpy (input->name,"Camera" ); +strscpy (input->name,"Camera" ,sizeof (input->name));return 0 ; }
@@ -990,8 +990,8 @@ static int viacam_s_fmt_vid_cap(struct file *filp, void *priv,static int viacam_querycap (struct file *filp,void *priv,struct v4l2_capability *cap) { -strcpy (cap->driver,"via-camera" ); -strcpy (cap->card,"via-camera" ); +strscpy (cap->driver,"via-camera" ,sizeof (cap->driver)); +strscpy (cap->card,"via-camera" ,sizeof (cap->card)); cap->device_caps =V4L2_CAP_VIDEO_CAPTURE |V4L2_CAP_READWRITE |V4L2_CAP_STREAMING ; cap->capabilities = cap->device_caps |V4L2_CAP_DEVICE_CAPS ;
drivers/media/platform/vivid/vivid-cec.c +2 -2
@@ -241,11 +241,11 @@ static int vivid_received(struct cec_adapter *adap, struct cec_msg *msg)cec_ops_set_osd_string (msg, &disp_ctl, osd);switch (disp_ctl) {case CEC_OP_DISP_CTL_DEFAULT : -strcpy (dev->osd, osd); +strscpy (dev->osd, osd,sizeof (dev->osd)); dev->osd_jiffies = jiffies;break ;case CEC_OP_DISP_CTL_UNTIL_CLEARED : -strcpy (dev->osd, osd); +strscpy (dev->osd, osd,sizeof (dev->osd)); dev->osd_jiffies =0 ;break ;case CEC_OP_DISP_CTL_CLEAR :
drivers/media/platform/vivid/vivid-core.c +2 -2
@@ -197,8 +197,8 @@ static int vidioc_querycap(struct file *file, void *priv, {struct vivid_dev *dev =video_drvdata (file); -strcpy (cap->driver,"vivid" ); -strcpy (cap->card,"vivid" ); +strscpy (cap->driver,"vivid" ,sizeof (cap->driver)); +strscpy (cap->card,"vivid" ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" , dev->v4l2_dev.name);
drivers/media/radio/dsbr100.c +1 -1
@@ -191,7 +191,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,return -EINVAL ;dsbr100_getstat (radio); -strcpy (v->name,"FM" ); +strscpy (v->name,"FM" ,sizeof (v->name)); v->type =V4L2_TUNER_RADIO ; v->rangelow =FREQ_MIN *FREQ_MUL ; v->rangehigh =FREQ_MAX *FREQ_MUL ;
drivers/media/radio/radio-ma901.c +1 -1
@@ -222,7 +222,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,* retval = ma901radio_get_stat(radio, &is_stereo, &v->signal); */ -strcpy (v->name,"FM" ); +strscpy (v->name,"FM" ,sizeof (v->name)); v->type =V4L2_TUNER_RADIO ; v->rangelow =FREQ_MIN *FREQ_MUL ; v->rangehigh =FREQ_MAX *FREQ_MUL ;
drivers/media/radio/radio-mr800.c +1 -1
@@ -291,7 +291,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,if (retval)return retval; -strcpy (v->name,"FM" ); +strscpy (v->name,"FM" ,sizeof (v->name)); v->type =V4L2_TUNER_RADIO ; v->rangelow =FREQ_MIN *FREQ_MUL ; v->rangehigh =FREQ_MAX *FREQ_MUL ;
drivers/media/radio/si470x/radio-si470x-common.c +1 -1
@@ -622,7 +622,7 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv, }/* driver constants */ -strcpy (tuner->name,"FM" ); +strscpy (tuner->name,"FM" ,sizeof (tuner->name)); tuner->type =V4L2_TUNER_RADIO ; tuner->capability =V4L2_TUNER_CAP_LOW |V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_RDS | V4L2_TUNER_CAP_RDS_BLOCK_IO |
drivers/media/radio/wl128x/fmdrv_v4l2.c +2 -2
@@ -249,7 +249,7 @@ static int fm_v4l2_vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *audio) {memset (audio,0 ,sizeof (*audio)); -strcpy (audio->name,"Radio" ); +strscpy (audio->name,"Radio" ,sizeof (audio->name)); audio->capability =V4L2_AUDCAP_STEREO ;return 0 ;
@@ -293,7 +293,7 @@ static int fm_v4l2_vidioc_g_tuner(struct file *file, void *priv,if (ret !=0 )return ret; -strcpy (tuner->name,"FM" ); +strscpy (tuner->name,"FM" ,sizeof (tuner->name)); tuner->type =V4L2_TUNER_RADIO ;/* Store rangelow and rangehigh freq in unit of 62.5 Hz */ tuner->rangelow = bottom_freq *16 ;
drivers/media/usb/au0828/au0828-video.c +9 -9
@@ -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);
drivers/media/usb/cpia2/cpia2_v4l.c +6 -6
@@ -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 :
drivers/media/usb/cx231xx/cx231xx-audio.c +4 -4
@@ -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);
drivers/media/usb/cx231xx/cx231xx-video.c +5 -4
@@ -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" );
drivers/media/usb/em28xx/em28xx-audio.c +4 -4
@@ -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);
drivers/media/usb/em28xx/em28xx-i2c.c +2 -1
@@ -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;
drivers/media/usb/em28xx/em28xx-video.c +11 -11
@@ -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);
drivers/media/usb/hdpvr/hdpvr-video.c +4 -3
@@ -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);
drivers/media/usb/pulse8-cec/pulse8-cec.c +2 -1
@@ -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 );
drivers/media/usb/pwc/pwc-if.c +1 -1
@@ -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);
drivers/media/usb/pwc/pwc-v4l.c +1 -1
@@ -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 |
drivers/media/usb/rainshadow-cec/rainshadow-cec.c +2 -1
@@ -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 ;
drivers/media/usb/stk1160/stk1160-i2c.c +1 -1
@@ -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);
drivers/media/usb/stk1160/stk1160-v4l.c +2 -2
@@ -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 |
drivers/media/usb/stkwebcam/stk-webcam.c +8 -8
@@ -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 ;
drivers/media/usb/tm6000/tm6000-alsa.c +3 -3
@@ -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);
drivers/media/usb/tm6000/tm6000-video.c +3 -3
@@ -1090,7 +1090,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 ;
@@ -1187,7 +1187,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 ;
@@ -1267,7 +1267,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 ;
drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c +1 -1
@@ -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);
drivers/media/usb/usbvision/usbvision-video.c +12 -10
@@ -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 ; }
drivers/media/usb/uvc/uvc_driver.c +1 -1
@@ -2138,7 +2138,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);
drivers/media/usb/zr364xx/zr364xx.c +2 -2
@@ -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 ; }
drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c +2 -1
@@ -639,7 +639,8 @@ static int vpfe_probe(struct platform_device *pdev) goto probe_disable_clock; vpfe_dev->media_dev.dev = vpfe_dev->pdev; -strcpy ((char *)&vpfe_dev->media_dev.model,"davinci-media" ); +strscpy ((char *)&vpfe_dev->media_dev.model,"davinci-media" , +sizeof (vpfe_dev->media_dev.model)); ret =media_device_register (&vpfe_dev->media_dev);if (ret) {
drivers/staging/media/imx/imx6-mipi-csi2.c +1 -1
@@ -597,7 +597,7 @@ static int csi2_probe(struct platform_device *pdev) csi2->sd.dev = &pdev->dev; csi2->sd.owner =THIS_MODULE ; csi2->sd.flags =V4L2_SUBDEV_FL_HAS_DEVNODE ; -strcpy (csi2->sd.name,DEVICE_NAME ); +strscpy (csi2->sd.name,DEVICE_NAME ,sizeof (csi2->sd.name)); csi2->sd.entity.function =MEDIA_ENT_F_VID_IF_BRIDGE ; csi2->sd.grp_id =IMX_MEDIA_GRP_ID_CSI2 ;
drivers/staging/media/zoran/zoran_card.c +1 -1
@@ -1048,7 +1048,7 @@ static int zr36057_init (struct zoran *zr) *zr->video_dev = zoran_template; zr->video_dev->v4l2_dev = &zr->v4l2_dev; zr->video_dev->lock = &zr->lock; -strcpy (zr->video_dev->name,ZR_DEVNAME (zr)); +strscpy (zr->video_dev->name,ZR_DEVNAME (zr),sizeof (zr->video_dev->name));/* It's not a mem2mem device, but you can both capture and output from one and the same device. This should really be split up into two device nodes, but that's a job for another day. */
Thanks,
Mauro
Re: [PATCH 3/3] media: replace strncpy() by strscpy()
In reply to Mauro Carvalho ChehabQuoted 32 lines · Mauro Carvalho Chehab
Em Mon, 10 Sep 2018 09:18:05 -0700
Kees Cook <[email protected]> escreveu:Quoted 10 lines
Quoted 2 lines · Mauro Carvalho Chehab
The
strncpy()function is being deprecated upstream. Replace it by the saferstrscpy().This one I'm quite concerned about. This could lead to kernel memory exposures if any of the callers depend on strncpy()'s trailing NUL-padding to clear a buffer of prior contents.
How did you validate that for these changes?
That's actually easy for those familiar with the V4L2 API. There are several fields at either uAPI or kAPI (or both) that have strings.
For example, a video input has a name.
So, for one familiar with the V4L2 API, it is clear that something like:
drivers/staging/media/zoran/zoran_driver.c +2
-0+strscpy (inp->name, zr->card.input[inp->index].name, +sizeof (inp->name));Is just filling the uAPI with the name of Input, with is, typically, something like:
S-Video
Television
Radio
Composite
Quoted 4 lines
A visual inspection of the patch shows that, on almost all cases, it is either filling a device driver's name (used mainly for debug routines), a video Input, a format description string, or the video caps fields name and driver.
It looks like the ioctl path also pre-clears the output buffer before handing it over to the per-driver routines, so I think this looks okay. It's a large patch, but if you're comfortable with it, go for it. :)
-Kees
Signature · 2 lines
Kees Cook Pixel Security
Re: [PATCH 2/3 v2] media: replace strcpy() by strscpy()
In reply to Mauro Carvalho ChehabQuoted 4 lines · Mauro Carvalho Chehab
The
strcpy()function is being deprecated upstream. Replace it by the saferstrscpy().Signed-off-by Mauro Carvalho Chehab <[email protected]>
Regards,
Hans
Re: [PATCH 1/3] media: use strscpy() instead of strlcpy()
In reply to Mauro Carvalho ChehabQuoted 5 lines · Mauro Carvalho Chehab
The implementation of
strscpy()is more robust and safer.That's now the recommended way to copy NUL terminated strings.
Signed-off-by Mauro Carvalho Chehab <[email protected]>
Re: [PATCH 3/3] media: replace strncpy() by strscpy()
In reply to Mauro Carvalho ChehabQuoted 39 lines · Mauro Carvalho Chehab
The
strncpy()function is being deprecated upstream. Replace it by the saferstrscpy().Signed-off-by Mauro Carvalho Chehab <[email protected]>--- drivers/media/dvb-frontends/as102_fe.c | 2 +- drivers/media/dvb-frontends/dib7000p.c | 3 ++- drivers/media/dvb-frontends/dib8000.c | 4 ++-- drivers/media/dvb-frontends/dib9000.c | 6 ++++-- drivers/media/dvb-frontends/dvb-pll.c | 2 +- drivers/media/dvb-frontends/m88ds3103.c | 2 +- drivers/media/pci/bt8xx/dst.c | 3 ++- drivers/media/pci/mantis/mantis_i2c.c | 2 +- drivers/media/pci/saa7134/saa7134-go7007.c | 2 +- drivers/media/platform/am437x/am437x-vpfe.c | 2 +- drivers/media/platform/davinci/vpfe_capture.c | 2 +- drivers/media/platform/davinci/vpif_capture.c | 2 +- drivers/media/platform/davinci/vpif_display.c | 3 +-- drivers/media/platform/exynos4-is/fimc-capture.c | 2 +- drivers/media/platform/exynos4-is/fimc-m2m.c | 2 +- drivers/media/platform/mtk-vpu/mtk_vpu.c | 2 +- drivers/media/platform/mx2_emmaprp.c | 4 ++-- drivers/media/platform/s5p-g2d/g2d.c | 6 +++--- drivers/media/platform/ti-vpe/vpe.c | 6 +++--- drivers/media/platform/vicodec/vicodec-core.c | 4 ++-- drivers/media/platform/vim2m.c | 4 ++-- drivers/media/radio/si4713/si4713.c | 2 +- drivers/media/usb/go7007/go7007-usb.c | 16 ++++++++-------- drivers/media/usb/go7007/go7007-v4l2.c | 2 +- drivers/media/usb/hdpvr/hdpvr-video.c | 9 +++------ drivers/media/usb/pulse8-cec/pulse8-cec.c | 4 ++-- drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 2 +- drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 4 ++-- drivers/staging/media/bcm2048/radio-bcm2048.c | 4 ++-- drivers/staging/media/imx/imx-ic-common.c | 2 +- drivers/staging/media/imx/imx-media-vdic.c | 2 +- drivers/staging/media/zoran/zoran_driver.c | 10 +++++----- 32 files changed, 61 insertions(+), 61 deletions(-)
<snip>
drivers/media/platform/davinci/vpfe_capture.c static int vpfe_probe(struct platform_device *pdev) · line 1762
Quoted 10 lines
drivers/media/platform/davinci/vpfe_capture.c +1
-1@@ -1759,7 +1759,7 @@ static int vpfe_probe(struct platform_device *pdev)mutex_lock (&ccdc_lock); -strncpy (ccdc_cfg->name, vpfe_cfg->ccdc,32 ); +strscpy (ccdc_cfg->name, vpfe_cfg->ccdc,32 );
32 -> sizeof(ccdc_cfg->name)
drivers/media/platform/davinci/vpif_capture.c static int vpif_s_dv_timings(struct file *file, void *priv, · line 1257
Quoted 13 lines
drivers/media/platform/davinci/vpfe_capture.c +0
-0/* Get VINT0 irq resource */ res1 =platform_get_resource (pdev,IORESOURCE_IRQ ,0 );if (!res1) {drivers/media/platform/davinci/vpif_capture.c +1
-1@@ -1254,7 +1254,7 @@ static int vpif_s_dv_timings(struct file *file, void *priv, }else { std_info->l5 = std_info->vsize - (bt->vfrontporch -1 ); } -strncpy (std_info->name,"Custom timings BT656/1120" ,VPIF_MAX_NAME ); +strscpy (std_info->name,"Custom timings BT656/1120" ,VPIF_MAX_NAME );
VPIF_MAX_NAME -> sizeof(std_info->name)
Quoted 8 lines
drivers/media/platform/davinci/vpif_capture.c +0
-0std_info->width = bt->width; std_info->height = bt->height; std_info->frm_fmt = bt->interlaced ?0 :1 ;drivers/media/platform/davinci/vpif_display.c +0
-0
drivers/media/platform/davinci/vpif_display.c static int vpif_s_dv_timings(struct file *file, void *priv, · line 990
Quoted 6 lines
drivers/media/platform/davinci/vpif_display.c +1
-2@@ -987,8 +987,7 @@ static int vpif_s_dv_timings(struct file *file, void *priv, }else { std_info->l5 = std_info->vsize - (bt->vfrontporch -1 ); } -strncpy (std_info->name,"Custom timings BT656/1120" , -VPIF_MAX_NAME ); +strscpy (std_info->name,"Custom timings BT656/1120" ,VPIF_MAX_NAME );
Ditto.
Quoted 3 lines
drivers/media/platform/davinci/vpif_display.c +0
-0std_info->width = bt->width; std_info->height = bt->height; std_info->frm_fmt = bt->interlaced ?0 :1 ;
<snip>
drivers/media/platform/mtk-vpu/mtk_vpu.c static void vpu_init_ipi_handler(void *data, unsigned int len, void *priv) · line 618
Quoted 10 lines
drivers/media/platform/mtk-vpu/mtk_vpu.c +1
-1@@ -615,7 +615,7 @@ static void vpu_init_ipi_handler(void *data, unsigned int len, void *priv)struct vpu_run *run = (struct vpu_run *)data; vpu->run.signaled = run->signaled; -strncpy (vpu->run.fw_ver, run->fw_ver,VPU_FW_VER_LEN ); +strscpy (vpu->run.fw_ver, run->fw_ver,VPU_FW_VER_LEN );
VPU_FW_VER_LEN -> sizeof(vpu->run.fw_ver)
Quoted 3 lines
drivers/media/platform/mtk-vpu/mtk_vpu.c +0
-0vpu->run.dec_capability = run->dec_capability; vpu->run.enc_capability = run->enc_capability;wake_up_interruptible (&vpu->run.wq);
<snip>
drivers/media/radio/si4713/si4713.c static int si4713_g_modulator(struct v4l2_subdev *sd, struct v4l2_modulator *vm) · line 1275
Quoted 10 lines
drivers/media/radio/si4713/si4713.c +1
-1@@ -1272,7 +1272,7 @@ static int si4713_g_modulator(struct v4l2_subdev *sd, struct v4l2_modulator *vm)if (vm->index >0 )return -EINVAL ; -strncpy (vm->name,"FM Modulator" ,32 ); +strscpy (vm->name,"FM Modulator" ,32 );
32 -> sizeof(vm->name)
Quoted 3 lines
drivers/media/radio/si4713/si4713.c +0
-0vm->capability =V4L2_TUNER_CAP_STEREO |V4L2_TUNER_CAP_LOW |V4L2_TUNER_CAP_RDS |V4L2_TUNER_CAP_RDS_CONTROLS ;
<snip>
Quoted 33 lines
drivers/media/usb/hdpvr/hdpvr-video.c +2
-5@@ -769,8 +769,7 @@ static int vidioc_enum_input(struct file *file, void *_fh, struct v4l2_input *i) i->type =V4L2_INPUT_TYPE_CAMERA ; -strncpy (i->name, iname[n],sizeof (i->name) -1 ); - i->name[sizeof (i->name) -1 ] ='\0' ; +strscpy (i->name, iname[n],sizeof (i->name)); i->audioset =1 <<HDPVR_RCA_FRONT |1 <<HDPVR_RCA_BACK |1 <<HDPVR_SPDIF ;@@ -841,8 +840,7 @@ static int vidioc_enumaudio(struct file *file, void *priv, audio->capability =V4L2_AUDCAP_STEREO ; -strncpy (audio->name, audio_iname[n],sizeof (audio->name) -1 ); - audio->name[sizeof (audio->name) -1 ] ='\0' ; +strscpy (audio->name, audio_iname[n],sizeof (audio->name));return 0 ; }@@ -874,7 +872,6 @@ static int vidioc_g_audio(struct file *file, void *private_data, audio->index = dev->options.audio_input; audio->capability =V4L2_AUDCAP_STEREO ;strscpy (audio->name, audio_iname[audio->index],sizeof (audio->name)); - audio->name[sizeof (audio->name) -1 ] ='\0' ;return 0 ; }
drivers/media/usb/hdpvr/hdpvr-video.c static int vidioc_enum_fmt_vid_cap(struct file *file, void *private_data, · line 991
Quoted 5 lines
drivers/media/usb/hdpvr/hdpvr-video.c +1
-1@@ -991,7 +988,7 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *private_data,return -EINVAL ; f->flags =V4L2_FMT_FLAG_COMPRESSED ; -strncpy (f->description,"MPEG2-TS with AVC/AAC streams" ,32 ); +strscpy (f->description,"MPEG2-TS with AVC/AAC streams" ,32 );
32 -> sizeof(f->description)
drivers/media/usb/pulse8-cec/pulse8-cec.c static int pulse8_setup(struct pulse8 *pulse8, struct serio *serio, · line 438
Quoted 13 lines
drivers/media/usb/hdpvr/hdpvr-video.c +0
-0f->pixelformat =V4L2_PIX_FMT_MPEG ;return 0 ;drivers/media/usb/pulse8-cec/pulse8-cec.c +1
-1@@ -435,7 +435,7 @@ static int pulse8_setup(struct pulse8 *pulse8, struct serio *serio, err =pulse8_send_and_wait (pulse8, cmd,1 , cmd[0 ],0 );if (err)return err; -strncpy (log_addrs->osd_name, data,13 ); +strscpy (log_addrs->osd_name, data,13 );
13 -> sizeof(log_addrs->osd_name)
drivers/media/usb/pulse8-cec/pulse8-cec.c static int pulse8_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr) · line 569
Quoted 9 lines
drivers/media/usb/pulse8-cec/pulse8-cec.c +1
-1dev_dbg (pulse8->dev,"OSD name: %s\n" , log_addrs->osd_name);return 0 ;@@ -566,7 +566,7 @@ static int pulse8_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr)char *osd_str = cmd +1 ; cmd[0 ] =MSGCODE_SET_OSD_NAME ; -strncpy (cmd +1 , adap->log_addrs.osd_name,13 ); +strscpy (cmd +1 , adap->log_addrs.osd_name,13 );
13 -> sizeof(cmd) - 1
Quoted 10 lines
drivers/media/usb/pulse8-cec/pulse8-cec.c +0
-0if (osd_len <4 ) {memset (osd_str + osd_len,' ' ,4 - osd_len); osd_len =4 ;drivers/media/usb/pvrusb2/pvrusb2-hdw.c +0
-0
drivers/media/usb/pvrusb2/pvrusb2-hdw.c struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, · line 2463
Quoted 6 lines
drivers/media/usb/pvrusb2/pvrusb2-hdw.c +1
-1@@ -2459,7 +2459,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,if (!(qctrl.flags &V4L2_CTRL_FLAG_READ_ONLY )) { ciptr->set_value = ctrl_cx2341x_set; } -strncpy (hdw->mpeg_ctrl_info[idx].desc,qctrl.name, +strscpy (hdw->mpeg_ctrl_info[idx].desc, qctrl.name,PVR2_CTLD_INFO_DESC_SIZE );
PVR2_CTLD_INFO_DESC_SIZE -> sizeof(hdw->mpeg_ctrl_info[idx].desc)
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c static int pvr2_enumaudio(struct file *file, void *priv, struct v4l2_audio *vin) · line 287
Quoted 12 lines
drivers/media/usb/pvrusb2/pvrusb2-hdw.c +0
-0hdw->mpeg_ctrl_info[idx].desc[PVR2_CTLD_INFO_DESC_SIZE -1 ] =0 ; ciptr->default_value = qctrl.default_value;drivers/media/usb/pvrusb2/pvrusb2-v4l2.c +1
-1@@ -284,7 +284,7 @@ static int pvr2_enumaudio(struct file *file, void *priv, struct v4l2_audio *vin)if (vin->index >0 )return -EINVAL ; -strncpy (vin->name,"PVRUSB2 Audio" ,14 ); +strscpy (vin->name,"PVRUSB2 Audio" ,14 );
14 -> sizeof(vin->name)
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c static int pvr2_g_audio(struct file *file, void *priv, struct v4l2_audio *vin) · line 296
Quoted 9 lines
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c +1
-1vin->capability =V4L2_AUDCAP_STEREO ;return 0 ; }@@ -293,7 +293,7 @@ static int pvr2_g_audio(struct file *file, void *priv, struct v4l2_audio *vin) {/* pkt: FIXME: see above comment (VIDIOC_ENUMAUDIO) */ vin->index =0 ; -strncpy (vin->name,"PVRUSB2 Audio" ,14 ); +strscpy (vin->name,"PVRUSB2 Audio" ,14 );
Ditto
drivers/staging/media/bcm2048/radio-bcm2048.c static int bcm2048_vidioc_g_audio(struct file *file, void *priv, · line 2406
Quoted 13 lines
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c +0
-0vin->capability =V4L2_AUDCAP_STEREO ;return 0 ; }drivers/staging/media/bcm2048/radio-bcm2048.c +1
-1@@ -2403,7 +2403,7 @@ static int bcm2048_vidioc_g_audio(struct file *file, void *priv,if (audio->index >1 )return -EINVAL ; -strncpy (audio->name,"Radio" ,32 ); +strscpy (audio->name,"Radio" ,32 );
32 -> sizeof(audio->name)
drivers/staging/media/bcm2048/radio-bcm2048.c static int bcm2048_vidioc_g_tuner(struct file *file, void *priv, · line 2434
Quoted 9 lines
drivers/staging/media/bcm2048/radio-bcm2048.c +1
-1audio->capability =V4L2_AUDCAP_STEREO ;return 0 ;@@ -2431,7 +2431,7 @@ static int bcm2048_vidioc_g_tuner(struct file *file, void *priv,if (tuner->index >0 )return -EINVAL ; -strncpy (tuner->name,"FM Receiver" ,32 ); +strscpy (tuner->name,"FM Receiver" ,32 );
32 -> sizeof(tuner->name)
drivers/staging/media/bcm2048/radio-bcm2048.c static int bcm2048_vidioc_g_tuner(struct file *file, void *priv, · line 2437
Quoted 3 lines
drivers/staging/media/bcm2048/radio-bcm2048.c +0
-0tuner->type =V4L2_TUNER_RADIO ; tuner->rangelow =dev_to_v4l2 (bcm2048_get_region_bottom_frequency (bdev));
<snip>
Basically using constants instead of sizeof() as the strscpy argument defeats the purpose of strscpy, so that needs to be fixed.
The 'strcpy' patch uses sizeof everywhere, but I saw a few other occurrences of this in the strlcpy patch. I think the strlcpy patch needs a follow-up that replaces any hardcoded sizes with the safer sizeof().
BTW, I really like this strncpy patch: in many cases strncpy was unsafe. Good to fix this.
Regards,
Hans