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)
commit18d8e199551c0ab53d2e87d071d24d38fac47277
treee9d61c680f3e593ae7748181d4537b03019cff6d
parentb15788b3613da20408517096ac608451274c9818
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