Skip to content

Commit

Permalink
V4L/DVB (9183): S2API: Return error of the caller provides 0 commands.
Browse files Browse the repository at this point in the history
S2API: Return error of the caller provides 0 commands.

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Steven Toth authored and Mauro Carvalho Chehab committed Oct 13, 2008
1 parent ef526f4 commit 6068f50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/media/dvb/dvb-core/dvb_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ static int dvb_frontend_ioctl_properties(struct inode *inode, struct file *file,

/* Put an arbitrary limit on the number of messages that can
* be sent at once */
if (tvps->num > DTV_IOCTL_MAX_MSGS)
if ((tvps->num == 0) || (tvps->num > DTV_IOCTL_MAX_MSGS))
return -EINVAL;

tvp = (struct dtv_property *) kmalloc(tvps->num *
Expand Down Expand Up @@ -1379,7 +1379,7 @@ static int dvb_frontend_ioctl_properties(struct inode *inode, struct file *file,

/* Put an arbitrary limit on the number of messages that can
* be sent at once */
if (tvps->num > DTV_IOCTL_MAX_MSGS)
if ((tvps->num == 0) || (tvps->num > DTV_IOCTL_MAX_MSGS))
return -EINVAL;

tvp = (struct dtv_property *) kmalloc(tvps->num *
Expand Down

0 comments on commit 6068f50

Please sign in to comment.