Re: Re: [PATCH] staging: media: davinci_vpfe: add error handling on kmalloc failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 19, 2018 at 01:24:57PM +0900, Ji-Hun Kim wrote:
> >   1294                          } else if (to && !from && size) {
> >   1295                                  rval = module_if->set(ipipe, NULL);
> >   1296                                  if (rval)
> >   1297                                          goto error;
> > 
> > And here again goto free_params.
> > 
> >   1298                          }
> >   1299                          kfree(params);
> >   1300                  }
> >   1301          }
> >   1302  error:
> >   1303          return rval;
> > 
> > 
> > Change this to:
> > 
> > 	return 0;
> Instead of returning rval, returning 0 would be fine? It looks that should
> return rval in normal case.
> 

In the proposed code, the errors all do a return or a goto so "rval"
would be zero here.  Then the error path would look like:

err_free_params:
	kfree(params);
	return rval;
}

regards,
dan carpenter


--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux