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>
 
                /* 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 *
 
                /* 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 *