V4L/DVB (9183): S2API: Return error of the caller provides 0 commands.
authorSteven Toth <stoth@linuxtv.org>
Tue, 7 Oct 2008 01:46:08 +0000 (22:46 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 13 Oct 2008 14:28:21 +0000 (12:28 -0200)
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>
drivers/media/dvb/dvb-core/dvb_frontend.c

index bd59c9514ab5b193bafac0db7ec516ad477d844c..f170e822fadce9016eeba24330d23101cbb01927 100644 (file)
@@ -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 *
@@ -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 *