Re: [RFC Patch] USB: Add check for portnum in the usb_acpi_find_device()

2013-06-02 Thread Lan Tianyu

On 2013/5/31 19:18 Greg KH wrote the following:

On Fri, May 31, 2013 at 02:18:06PM +0800, Lan Tianyu wrote:

This patch is to add a check of "portnum" which from the usb
port dev's name.


Why do we need this now?


The "portnum" will be used as array index
for struct usb_hub->ports in the usb_set_hub_port_connect_type().


Is something failing today without this check?  We don't add code to the
kernel until we need it...

No, actually current code will not fail. The patch is the result of
analysis tools "Klockwork" which is pushed by some QAs. I just notice 
you have said "to be over-eager in checking parameters that we have full 
control of is not needed at all". So please ignore this. Sorry for noise.


http://marc.info/?l=linux-usb&m=136984950910015&w=2


thanks,

greg k-h



--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC Patch] USB: Add check for portnum in the usb_acpi_find_device()

2013-05-31 Thread Greg KH
On Fri, May 31, 2013 at 02:18:06PM +0800, Lan Tianyu wrote:
> This patch is to add a check of "portnum" which from the usb
> port dev's name.

Why do we need this now?

> The "portnum" will be used as array index
> for struct usb_hub->ports in the usb_set_hub_port_connect_type().

Is something failing today without this check?  We don't add code to the
kernel until we need it...

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html