]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit1045431ff3dde55eaa0224bff95c715287b009f0
tree3fb0e9a67614fd0197363569b0f579b76a427c55
parentc3a8354c95379e5c8932580b6408ed836e87e399
usb: gadget: Potential NULL dereference on allocation error

BugLink: https://bugs.launchpad.net/bugs/1837813
[ Upstream commit df28169e1538e4a8bcd8b779b043e5aa6524545c ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/usb/gadget/function/f_sourcesink.c