Re: [PATCH] genetlink: fix unsigned int comparison with less than zero

2016-11-13 Thread Cong Wang
On Sun, Nov 13, 2016 at 9:15 AM, David Miller wrote: > I've commited the following to net-next: > > > [PATCH] genetlink: Make family a signed integer. > > The idr_alloc(), idr_remove(), et al. routines all expect IDs to be > signed integers. Therefore

Re: [PATCH] genetlink: fix unsigned int comparison with less than zero

2016-11-13 Thread David Miller
From: Colin King Date: Thu, 10 Nov 2016 15:57:58 + > From: Colin Ian King > > family->id is unsigned, so the less than zero check for > failure return from idr_alloc is never true and so the error exit > is never handled. Instead, assign

Re: [PATCH] genetlink: fix unsigned int comparison with less than zero

2016-11-12 Thread Johannes Berg
> > I suppose it could be, since family IDs are allocated in a 16-bit > > range > > anyway. But family IDs can also never actually be negative, so > > having > > an unsigned int in the struct makes sense too. > > All idr_* API's accept int, rather than unsigned int. This is my > point. Sure,

Re: [PATCH] genetlink: fix unsigned int comparison with less than zero

2016-11-12 Thread Cong Wang
On Sat, Nov 12, 2016 at 1:37 PM, Johannes Berg wrote: > On Thu, 2016-11-10 at 09:11 -0800, Cong Wang wrote: >> On Thu, Nov 10, 2016 at 7:57 AM, Colin King > > wrote: >> > >> > From: Colin Ian King >> > >> >

Re: [PATCH] genetlink: fix unsigned int comparison with less than zero

2016-11-12 Thread Johannes Berg
On Thu, 2016-11-10 at 09:11 -0800, Cong Wang wrote: > On Thu, Nov 10, 2016 at 7:57 AM, Colin King > wrote: > > > > From: Colin Ian King > > > > family->id is unsigned, so the less than zero check for > > failure return from idr_alloc is

Re: [PATCH] genetlink: fix unsigned int comparison with less than zero

2016-11-10 Thread Cong Wang
On Thu, Nov 10, 2016 at 7:57 AM, Colin King wrote: > From: Colin Ian King > > family->id is unsigned, so the less than zero check for > failure return from idr_alloc is never true and so the error exit > is never handled. Instead, assign err