Staging: Media: Lirc - Fix possible ERR_PTR() dereferencing.

Dan Carpenter dan.carpenter at oracle.com
Tue Sep 20 08:45:11 UTC 2016


On Tue, Sep 20, 2016 at 12:21:21PM +0530, Shailendra Verma wrote:
> This is of course wrong to call kfree() if memdup_user() fails,
> no memory was allocated and the error in the error-valued pointer
> should be returned.
> 
> Reviewed-by: Ravikant Sharma <ravikant.s2 at samsung.com>
> Signed-off-by: Shailendra Verma <shailendra.v at samsung.com>

Calling kfree(NULL) is fine so there is no bug in the original code.
Also this patch creates a new locking bug.

regards,
dan carpenter



More information about the devel mailing list