diff options
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/media/bcm2048/radio-bcm2048.c | 4 | ||||
-rw-r--r-- | drivers/staging/media/imx/imx-ic-common.c | 2 | ||||
-rw-r--r-- | drivers/staging/media/imx/imx-media-vdic.c | 2 | ||||
-rw-r--r-- | drivers/staging/media/zoran/zoran_driver.c | 10 |
4 files changed, 9 insertions, 9 deletions
diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c index d9b02ff66259..09903ffb13ba 100644 --- a/drivers/staging/media/bcm2048/radio-bcm2048.c +++ b/drivers/staging/media/bcm2048/radio-bcm2048.c @@ -2404,7 +2404,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", sizeof(audio->name)); audio->capability = V4L2_AUDCAP_STEREO; return 0; @@ -2432,7 +2432,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", sizeof(tuner->name)); tuner->type = V4L2_TUNER_RADIO; tuner->rangelow = dev_to_v4l2(bcm2048_get_region_bottom_frequency(bdev)); diff --git a/drivers/staging/media/imx/imx-ic-common.c b/drivers/staging/media/imx/imx-ic-common.c index 90a926891eb9..1addb0893c57 100644 --- a/drivers/staging/media/imx/imx-ic-common.c +++ b/drivers/staging/media/imx/imx-ic-common.c @@ -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) diff --git a/drivers/staging/media/imx/imx-media-vdic.c b/drivers/staging/media/imx/imx-media-vdic.c index f8c84a07dad9..5439b88dba20 100644 --- a/drivers/staging/media/imx/imx-media-vdic.c +++ b/drivers/staging/media/imx/imx-media-vdic.c @@ -964,7 +964,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); diff --git a/drivers/staging/media/zoran/zoran_driver.c b/drivers/staging/media/zoran/zoran_driver.c index 04f88f9d6bb4..c998aa4dc73b 100644 --- a/drivers/staging/media/zoran/zoran_driver.c +++ b/drivers/staging/media/zoran/zoran_driver.c @@ -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; } |