[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140519161548.GZ12304@sirena.org.uk>
Date: Mon, 19 May 2014 17:15:48 +0100
From: Mark Brown <broonie@...nel.org>
To: Xiubo Li <Li.Xiubo@...escale.com>
Cc: gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] regmap: irq: Fix possible ZERO_SIZE_PTR pointer
dereferencing error.
On Mon, May 19, 2014 at 03:13:45PM +0800, Xiubo Li wrote:
> Since we cannot make sure the 'chip->num_regs' will always be none zero
> from the users, and then if 'chip->num_regs' equals to zero by mistake
> or other reasons, the kzalloc() will return ZERO_SIZE_PTR, which equals
> to ((void *)16).
>
> So this patch fix this with just checking the 'chip->num_regs' before
> calling kzalloc().
Where is the actual dereference that's being protected against here?
> This also sorts the header files in alphabetical order at the same time.
No, don't do things like this. It just makes things harder to review.
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists