Skip to content

Commit

Permalink
[media] saa7164: make buffer smaller
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Mauro Carvalho Chehab committed Dec 29, 2010
1 parent 76e4a9a commit 0e72cc8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/media/video/saa7164/saa7164-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/saa7164/saa7164.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0e72cc8

Please sign in to comment.