提交 0e72cc8b 编写于 作者: D Dan Carpenter 提交者: Mauro Carvalho Chehab

[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: NDan Carpenter <error27@gmail.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 76e4a9a7
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册