diff options
author | Ma Ke <make_ruc2021@163.com> | 2024-12-18 15:13:46 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-23 18:54:04 +0100 |
commit | 0df11fa8cee5a9cf8753d4e2672bb3667138c652 (patch) | |
tree | cadc1c46fa58375e89a2482411827249be825622 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 862a9c0f68487fd6ced15622d9cdcec48f8b5aaa (diff) |
usb: fix reference leak in usb_new_device()
When device_add(&udev->dev) succeeds and a later call fails,
usb_new_device() does not properly call device_del(). As comment of
device_add() says, 'if device_add() succeeds, you should call
device_del() when you want to get rid of it. If device_add() has not
succeeded, use only put_device() to drop the reference count'.
Found by code review.
Cc: stable <stable@kernel.org>
Fixes: 9f8b17e643fe ("USB: make usbdevices export their device nodes instead of using a separate class")
Signed-off-by: Ma Ke <make_ruc2021@163.com>
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20241218071346.2973980-1-make_ruc2021@163.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions