]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: Potential NULL dereference on allocation error
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 21 Dec 2018 20:42:52 +0000 (23:42 +0300)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 14 Jan 2019 08:29:55 +0000 (10:29 +0200)
commit2e28633d10b6bf7b44f868bd0f723926008f23f9
tree86e8a8cfd978923df8a75c6c22387b943cea1184
parent5d721841ce7c0b06bdc03912b16cd795271be8a0
usb: gadget: Potential NULL dereference on allocation error

The source_sink_alloc_func() function is supposed to return error
pointers on error.  The function is called from usb_get_function() which
doesn't check for NULL returns so it would result in an Oops.

Of course, in the current kernel, small allocations always succeed so
this doesn't affect runtime.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/function/f_sourcesink.c