diff options
| author | Ma Ke <[email protected]> | 2025-03-03 07:27:39 +0000 |
|---|---|---|
| committer | Vinod Koul <[email protected]> | 2025-05-14 11:28:43 +0000 |
| commit | b2ea5f49580c0762d17d80d8083cb89bc3acf74f (patch) | |
| tree | acbfcb2ce7f0adc7bc9711ca9fb3dc2dfe65081d /drivers/iommu/intel/nested.c | |
| parent | phy: renesas: rcar-gen3-usb2: Set timing registers only once (diff) | |
| download | kernel-b2ea5f49580c0762d17d80d8083cb89bc3acf74f.tar.gz kernel-b2ea5f49580c0762d17d80d8083cb89bc3acf74f.zip | |
phy: Fix error handling in tegra_xusb_port_init
If device_add() fails, do not use device_unregister() for error
handling. device_unregister() consists two functions: device_del() and
put_device(). device_unregister() should only be called after
device_add() succeeded because device_del() undoes what device_add()
does if successful. Change device_unregister() to put_device() call
before returning from the function.
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: [email protected]
Fixes: 53d2a715c240 ("phy: Add Tegra XUSB pad controller support")
Signed-off-by: Ma Ke <[email protected]>
Acked-by: Thierry Reding <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
Diffstat (limited to 'drivers/iommu/intel/nested.c')
0 files changed, 0 insertions, 0 deletions
