fix usb null pointer reference

Signed-off-by: wu <wuzhimin8@huawei.com>
This commit is contained in:
wu
2022-03-19 01:40:20 -07:00
committed by wuzhimin
parent a11b8b0bd4
commit 3060bf27a6
+5
View File
@@ -532,6 +532,11 @@ static int32_t GadgetPnpNotifyHdfSendEvent(const struct HdfDeviceObject *deviceO
static int32_t UsbPnpNotifyFirstReport(struct usb_device *usbDev, void *data)
{
int32_t ret;
if (data == NULL) {
HDF_LOGE("%{pubilc}s:%{pubilc}d data is NULL", __func__, __LINE__);
return HDF_FAILURE;
}
struct HdfDeviceIoClient *client = (struct HdfDeviceIoClient *)data;
ret = UsbPnpNotifyHdfSendEvent(client->device, usbDev);