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

From: Cong Wang
Date: Thu Nov 10 2016 - 12:11:56 EST


On Thu, Nov 10, 2016 at 7:57 AM, Colin King <colin.king@xxxxxxxxxxxxx> wrote:
> From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
>
> 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 and check if this is less
> than zero since this is a signed integer.

Why family->id can't be just signed int? For me it should be.