f_mtp:Fix ptp kernel panic in factory mode
authora17671 <a17671@motorola.com>
Fri, 1 Feb 2019 05:19:09 +0000 (13:19 +0800)
committerxiest1 <xiest1@lenovo.com>
Tue, 5 Nov 2019 09:30:43 +0000 (17:30 +0800)
commit726d11f025f2c29d284454a80bcf794089b54ae8
treee9d61c680f3e593ae7748181d4537b03019cff6d
parent94e27e2c2bca45b961f0d8f037c04f769d5a122c
f_mtp:Fix ptp kernel panic in factory mode

cdev could be null in the switching
PTP case, check the state before reading
To fix the panic issue

Change-Id: I30471023a72457854140ae867ed3977fba834dc0
Signed-off-by: a17671 <a17671@motorola.com>
Reviewed-on: https://gerrit.mot.com/1303922
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
drivers/usb/gadget/function/f_mtp.c