RE: [PATCH] regmap: fix possible ZERO_SIZE_PTR pointer dereferencing error.

2014-09-29 Thread li.xi...@freescale.com
Hi, > > > diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c > > index 455a877..3d93e38 100644 > > --- a/drivers/base/regmap/regmap.c > > +++ b/drivers/base/regmap/regmap.c > > @@ -1716,6 +1716,9 @@ out: > > Whatever you're using to generate the patches isn't annotating wit

Re: [PATCH] regmap: fix possible ZERO_SIZE_PTR pointer dereferencing error.

2014-09-28 Thread Mark Brown
On Sun, Sep 28, 2014 at 05:09:54PM +0800, Xiubo Li wrote: > Since we cannot make sure the 'val_count' will always be none zero > here, and then if it equals to zero, the kmemdup() will return > ZERO_SIZE_PTR, which equals to ((void *)16). Applied, thanks. > diff --git a/drivers/base/regmap/regm

RE: [PATCH] regmap: fix possible ZERO_SIZE_PTR pointer dereferencing error.

2014-09-28 Thread li.xi...@freescale.com
Hi Mark, > Subject: [PATCH] regmap: fix possible ZERO_SIZE_PTR pointer dereferencing > error. > > Since we cannot make sure the 'val_count' will always be none zero > here, and then if it equals to zero, the kmemdup() will return > ZERO_SIZE_PTR, which equals to ((void *)16). > > So this patch

Re: [PATCH] regmap: Fix possible ZERO_SIZE_PTR pointer dereferencing error.

2014-04-30 Thread Mark Brown
On Wed, Apr 30, 2014 at 05:31:08PM +0800, Xiubo Li wrote: > Since we cannot make sure the 'len = pair_size * num_regs' will always > be none zero from the users, and then if 'num_regs' equals to zero by > mistake or other reasons, the kzalloc() will return ZERO_SIZE_PTR, which > equals to ((void *)