summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7164
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-11-02 04:22:23 +0100
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-12-29 11:16:39 +0100
commit0e72cc8b8d48ba05e705f432fb99aaa0ea6737c6 (patch)
tree466279b5e4095bc95e3df1558ab3484601ee6504 /drivers/media/video/saa7164
parent[media] tea6415c: return -EIO if i2c_check_functionality fails (diff)
downloadlinux-0e72cc8b8d48ba05e705f432fb99aaa0ea6737c6.tar.xz
linux-0e72cc8b8d48ba05e705f432fb99aaa0ea6737c6.zip
[media] saa7164: make buffer smaller
This isn't a runtime bug, it's just to make static checkers happy. In vidioc_querycap() we copy a saa7164_dev ->name driver array into a v4l2_capability -> driver array. The ->driver array is only 16 chars long so ->name also can't be more than 16 characters. The ->name gets set in v4l2_capability() and it always is less than 16 characters so we can easily make the buffer smaller. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7164')
-rw-r--r--drivers/media/video/saa7164/saa7164-core.c2
-rw-r--r--drivers/media/video/saa7164/saa7164.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/video/saa7164/saa7164-core.c b/drivers/media/video/saa7164/saa7164-core.c
index e1bac5051460..b66f78f7042c 100644
--- a/drivers/media/video/saa7164/saa7164-core.c
+++ b/drivers/media/video/saa7164/saa7164-core.c
@@ -1001,7 +1001,7 @@ static int saa7164_dev_setup(struct saa7164_dev *dev)
atomic_inc(&dev->refcount);
dev->nr = saa7164_devcount++;
- sprintf(dev->name, "saa7164[%d]", dev->nr);
+ snprintf(dev->name, sizeof(dev->name), "saa7164[%d]", dev->nr);
mutex_lock(&devlist);
list_add_tail(&dev->devlist, &saa7164_devlist);
diff --git a/drivers/media/video/saa7164/saa7164.h b/drivers/media/video/saa7164/saa7164.h
index 041ae8e20f68..74df9c627a96 100644
--- a/drivers/media/video/saa7164/saa7164.h
+++ b/drivers/media/video/saa7164/saa7164.h
@@ -447,7 +447,7 @@ struct saa7164_dev {
int nr;
int hwrevision;
u32 board;
- char name[32];
+ char name[16];
/* firmware status */
struct saa7164_fw_status fw_status;