Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1463093

Re: [PATCH] USB: core: of: Check device_node before parsing in usb_of_get_child_node()

From Greg KH <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH] USB: core: of: Check device_node before parsing in usb_of_get_child_node()
Date 2016-08-15 20:50 +0200
Message-ID <s6v7s-II-17@gated-at.bofh.it> (permalink)
References <s6uXL-F9-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Aug 15, 2016 at 11:31:10AM -0700, Vaibhav Hiremath wrote:
> In case of HUB devices connected to USB ports, we may not have DT
> node representing it inside USB, and when devices connected to hub
> gets enumerated, call to usb_of_get_child_node() leads to NULL pointer
> dereference.

Really?  That seems messed up.

> In the usecase we have, where EHCI port is connected to USB HUB
> device, and downward ports of HUB are connected to further USB
> devices. When those devices gets enumerated, in order,
>  1. USB HUB ->
> 	-> Call to usb_of_get_child_node() is OK, as
> 	parent->dev.of_node is pointing to host node.
>  2. Devices connected to downward port of USB HUB
>  	-> Call to usb_of_get_child_node() leads to NULL
> 	pointer dereference as parent->dev.of_node = NULL,
> 	as USB HUB DTS node may be empty.

Why is the hub DTS empty?  Shouldn't that be the fix here?

thanks,

greg k-h

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] USB: core: of: Check device_node before parsing in usb_of_get_child_node() Vaibhav Hiremath <vaibhav.hiremath@linaro.org> - 2016-08-15 20:40 +0200
  Re: [PATCH] USB: core: of: Check device_node before parsing in  usb_of_get_child_node() Greg KH <gregkh@linuxfoundation.org> - 2016-08-15 20:50 +0200
    Re: [PATCH] USB: core: of: Check device_node before parsing in  usb_of_get_child_node() Vaibhav Hiremath <vaibhav.hiremath@linaro.org> - 2016-08-15 21:20 +0200
    Re: [PATCH] USB: core: of: Check device_node before parsing in  usb_of_get_child_node() Alan Stern <stern@rowland.harvard.edu> - 2016-08-15 21:40 +0200
  Re: [PATCH] USB: core: of: Check device_node before parsing in  usb_of_get_child_node() Peter Chen <hzpeterchen@gmail.com> - 2016-08-16 03:50 +0200
    Re: [PATCH] USB: core: of: Check device_node before parsing in  usb_of_get_child_node() Vaibhav Hiremath <vaibhav.hiremath@linaro.org> - 2016-08-16 23:30 +0200

csiph-web