Merge tag 'media/v4.20-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
[linux-2.6-block.git] / drivers / media / pci / cx88 / cx88-video.c
index 85e2b6c9fb1c5aad293e28c2bddc902cb324a862..e1549d352f707dcb59b17d0b8f69c1ba78871e70 100644 (file)
@@ -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;
@@ -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);
 }
@@ -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;
@@ -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;