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@xxxxxxxxxxx> > --- > 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 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel