diff options
| author | Ma Ke <[email protected]> | 2024-12-18 07:13:46 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2024-12-23 17:54:04 +0000 |
| commit | 0df11fa8cee5a9cf8753d4e2672bb3667138c652 (patch) | |
| tree | cadc1c46fa58375e89a2482411827249be825622 /tools/net/ynl/pyynl/cli.py | |
| parent | usb: typec: tcpci: fix NULL pointer issue on shared irq case (diff) | |
| download | kernel-0df11fa8cee5a9cf8753d4e2672bb3667138c652.tar.gz kernel-0df11fa8cee5a9cf8753d4e2672bb3667138c652.zip | |
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 <[email protected]>
Fixes: 9f8b17e643fe ("USB: make usbdevices export their device nodes instead of using a separate class")
Signed-off-by: Ma Ke <[email protected]>
Reviewed-by: Alan Stern <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/net/ynl/pyynl/cli.py')
0 files changed, 0 insertions, 0 deletions
