diff
< 	struct usb_device *hdev = to_usb_device(dev->parent->parent);
< 	struct usb_hub *hub = usb_hub_to_struct_hub(hdev);
< 	struct usb_interface *intf = to_usb_interface(hub->intfdev);
---
> 	struct usb_device *hdev;
> 	struct usb_hub *hub;
> 	struct usb_interface *intf;
> 	hdev = to_usb_device(dev->parent->parent);
> 	if (!hdev)
> 	    return -ENODEV;
> 	hub = usb_hub_to_struct_hub(hdev);
> 	if (!hub)
> 	    return -ENODEV;
> 	intf = to_usb_interface(hub->intfdev);
