]> www.infradead.org Git - users/jedix/linux-maple.git/commit
usb: gadget: composite: Fix NULL pointer dereference
authorKishon Vijay Abraham I <kishon@ti.com>
Thu, 11 Jun 2015 16:42:11 +0000 (22:12 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Aug 2015 16:29:05 +0000 (09:29 -0700)
commitc856349b0e83bf406242a1a3e44f8391d71fd5a8
treeff82ff64e27ddfc79634208c1bc79d2c15c84ffb
parenta808fa062ff7ec85b7b0a344df52329083f044b0
usb: gadget: composite: Fix NULL pointer dereference

commit b4c21f0bdd2c0cd5d5be1bb56f0a28dae5041eed upstream.

commit f563d230903210acc ("usb: gadget: composite: add req_match method
to usb_function") accesses cdev->config even before set config
is invoked causing a NULL pointer dereferencing error while running
Lecroy Mass Storage Compliance test.

Fix it here by accessing cdev->config only if it is non NULL.

Fixes: commit f563d230903210acc ("usb: gadget: composite: add req_match
method to usb_function").

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/composite.c