usb: gadget: f_mtp: simplify ptp NULL pointer check
authorAmit Pundir <amit.pundir@linaro.org>
Tue, 11 Aug 2015 07:04:45 +0000 (12:34 +0530)
committerAmit Pundir <amit.pundir@linaro.org>
Thu, 1 Dec 2016 09:48:16 +0000 (15:18 +0530)
commita40aba04f22a274b0f6e8f6b2e051704997208b4
tree6d84234b388628f4ecf367950528aaee77bc58e9
parentc39fa164766e4ead0594e8b6fd382b57fd9d5a1f
usb: gadget: f_mtp: simplify ptp NULL pointer check

Simplify MTP/PTP dev NULL pointer check introduced in
Change-Id: Ic44a699d96df2e13467fc081bff88b97dcc5afb2
and restrict it to MTP/PTP function level only.

Return ERR_PTR() instead of NULL from mtp_ptp function
to skip doing NULL pointer checks all the way up to
configfs.c

Fixes: Change-Id: Ic44a699d96df2e13467fc081bff88b97dcc5afb2
       ("usb: gadget: fix NULL ptr derefer while symlinking PTP func")
Change-Id: Iab7c55089c115550c3506f6cca960a07ae52713d
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
drivers/usb/gadget/configfs.c
drivers/usb/gadget/function/f_mtp.c
drivers/usb/gadget/functions.c