]> git.baikalelectronics.ru Git - kernel.git/commit
usb: core: Fix potential memory leak adding dyn USBdevice IDs
authorChristian Engelmayer <cengelma@gmx.at>
Tue, 28 Jan 2014 21:22:27 +0000 (22:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Feb 2014 19:39:30 +0000 (11:39 -0800)
commit912de722749aa3203b6fc03e162d2c1e3ad31617
tree0454a2c0cadfac3273ee0f7b450500755417ef51
parente99c506c31e3922b553a4197be9cb2f0c00ddb12
usb: core: Fix potential memory leak adding dyn USBdevice IDs

Fix a memory leak in the usb_store_new_id() error paths. When bailing out
due to sanity checks, the function left the already allocated usb_dynid
struct in place. This regression was introduced by the following commits:

200ce2b6 (usb: core: add sanity checks when using bInterfaceClass with new_id)
ab4ffa46 (usb: core: check for valid id_table when using the RefId feature)
b96e4386 (usb: core: bail out if user gives an unknown RefId when using new_id)

Detected by Coverity: CID 1162604.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Acked-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/driver.c