Re: [patch] [media] av7110: make array offset unsigned

2011-01-07 Thread Andreas Oberritter
On 01/07/2011 02:51 PM, Dan Carpenter wrote: > On Fri, Jan 07, 2011 at 01:44:15PM +0100, Andreas Oberritter wrote: >> Nack. You're changing an interface to userspace. Please add a check to >> av7110_ca.c instead. >> > > Ok. I've done that and resent the patch. Thanks. I'm OK with the patch, but

Re: [patch] [media] av7110: make array offset unsigned

2011-01-07 Thread Vasiliy Kulikov
On Fri, Jan 07, 2011 at 16:51 +0300, Dan Carpenter wrote: > But just for my own understanding, why is it wrong to change an int to > an unsigned int in the userspace API? Who would notice? E.g. the same check in userspace (var < 0). If var has changed the sign then the result would differ. --

Re: [patch] [media] av7110: make array offset unsigned

2011-01-07 Thread Dan Carpenter
On Fri, Jan 07, 2011 at 01:44:15PM +0100, Andreas Oberritter wrote: > Nack. You're changing an interface to userspace. Please add a check to > av7110_ca.c instead. > Ok. I've done that and resent the patch. But just for my own understanding, why is it wrong to change an int to an unsigned int i

Re: [patch] [media] av7110: make array offset unsigned

2011-01-07 Thread Andreas Oberritter
On 01/06/2011 08:41 PM, Dan Carpenter wrote: > In the CA_GET_SLOT_INFO ioctl, we only check whether "num" is too large, > but we don't check if it's negative. > > drivers/media/dvb/ttpci/av7110_ca.c >278ca_slot_info_t *info=(ca_slot_info_t *)parg; >279 >280

[patch] [media] av7110: make array offset unsigned

2011-01-06 Thread Dan Carpenter
In the CA_GET_SLOT_INFO ioctl, we only check whether "num" is too large, but we don't check if it's negative. drivers/media/dvb/ttpci/av7110_ca.c 278 ca_slot_info_t *info=(ca_slot_info_t *)parg; 279 280 if (info->num > 1) 281 return -EINVAL; 282