usbcore: compare and release one bos descriptor in usb_reset_and_verify_device()
authorXenia Ragiadakou <burzalodowa@gmail.com>
Thu, 29 Aug 2013 18:45:48 +0000 (21:45 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Aug 2013 19:02:08 +0000 (12:02 -0700)
commite3376d6c87eea09bd65ece6073f6e5d47aa560a3
tree0d44a8f7a1f48d61534fec9cdaa0d4b3bbe29cd0
parenteb5ea7300d48c52b028966a6e59f9244faa930d0
usbcore: compare and release one bos descriptor in usb_reset_and_verify_device()

In usb_reset_and_verify_device(), hub_port_init() allocates a new bos
descriptor to hold the value read by the device. The new bos descriptor
has to be compared with the old one in order to figure out if device 's
firmware has changed in which case the device has to be reenumerated.
In the original code, none of the two descriptors was deallocated leading
to memory leaks.

This patch compares the old bos descriptor with the new one to detect change
in firmware and releases the newly allocated bos descriptor to prevent memory
leak.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Reported-by: Martin MOKREJS <mmokrejs@gmail.com>
Tested-by: Martin MOKREJS <mmokrejs@gmail.com>
Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hub.c
This page took 0.028103 seconds and 5 git commands to generate.