summaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/hub.h
diff options
context:
space:
mode:
authorMathias Nyman2013-06-18 16:28:48 +0200
committerGreg Kroah-Hartman2013-06-18 20:02:04 +0200
commit41341261aa1707b49f937ba2c20d1a0daa5afac3 (patch)
tree7f7e80ab0396c7b0381013461d94ef9af852168a /drivers/usb/core/hub.h
parentxhci: check for failed dma pool allocation (diff)
downloadkernel-qcow2-linux-41341261aa1707b49f937ba2c20d1a0daa5afac3.tar.gz
kernel-qcow2-linux-41341261aa1707b49f937ba2c20d1a0daa5afac3.tar.xz
kernel-qcow2-linux-41341261aa1707b49f937ba2c20d1a0daa5afac3.zip
usb: check usb_hub_to_struct_hub() return value
usb_hub_to_struct_hub() can return NULL in some unlikely cases. Add checks where appropriate, or pass the hub pointer as an additional argument if it's known to be valid. The places it makes sense to check usb_hub_to_struct_hub() are picked based on feedback from Alan Stern. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/hub.h')
-rw-r--r--drivers/usb/core/hub.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h
index 80ab9ee07017..6508e02b3dac 100644
--- a/drivers/usb/core/hub.h
+++ b/drivers/usb/core/hub.h
@@ -100,7 +100,7 @@ extern int usb_hub_create_port_device(struct usb_hub *hub,
int port1);
extern void usb_hub_remove_port_device(struct usb_hub *hub,
int port1);
-extern int usb_hub_set_port_power(struct usb_device *hdev,
+extern int usb_hub_set_port_power(struct usb_device *hdev, struct usb_hub *hub,
int port1, bool set);
extern struct usb_hub *usb_hub_to_struct_hub(struct usb_device *hdev);
extern int hub_port_debounce(struct usb_hub *hub, int port1,