[PATCH] staging: dgnc: check return value of kzalloc

Gujulan Elango, Hari Prasath (H.) hgujulan at visteon.com
Fri May 29 06:46:56 UTC 2015


On Thu, May 28, 2015 at 04:32:30PM +0300, Dan Carpenter wrote:
> On Thu, May 28, 2015 at 01:23:57PM +0000, Gujulan Elango, Hari Prasath (H.) wrote:
> > Check the return value of kzalloc & return error if it fails.
> > 
> > Signed-off-by: Gujulan Elango Hari Prasath <hgujulan at visteon.com>
> > ---
> >  drivers/staging/dgnc/dgnc_driver.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
> > index 935e297..2c729be 100644
> > --- a/drivers/staging/dgnc/dgnc_driver.c
> > +++ b/drivers/staging/dgnc/dgnc_driver.c
> > @@ -589,6 +589,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
> >  	 * context, and there are no locks held.
> >  	 */
> >  	brd->flipbuf = kzalloc(MYFLIPLEN, GFP_KERNEL);
> > +	if (!brd->flipbuf)
> > +		return -ENOMEM;
> 
> Just delete flipbuf and all the references to it.
> 
> regards,
> dan carpenter
> 

ok I checked it out before.flipbuf is not used anywhere in this driver.I
will go ahead and delete all references to it and send out a new
patch.Let us discard this patch as it makes no sense.

regards
Hari Prasath


More information about the devel mailing list