usb/gadget: android: Handle NULL pointer dereference in android_probe()
In android probe(), 'usb_core_id' filed is passed as part of platform
data and is used as id for the usb android device. If platform data is
itself NULL, then accessing pdata.usb_core_id would lead to NULL
pointer deference.
This change adds NULL check for pdata in android_probe() before
using pdata.usb_core_id with android_create_device(). If pdata is
itself NULL, then use value 0 with android_create_device(), since the
primary usb core should always have usb_core_id as 0.
CRs-Fixed: 561002
Change-Id: I7ce131a9f8d57e519f8a9e1f44c770725358cff0
Signed-off-by:
Saket Saurabh <ssaurabh@codeaurora.org>
Loading
Please register or sign in to comment