diff options
author | Zijun Hu <quic_zijuhu@quicinc.com> | 2024-07-22 22:48:10 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-07-31 14:54:47 +0200 |
commit | 6d8249ac29bc23260dfa9747eb398ce76012d73c (patch) | |
tree | f472a5780747a2b8c3c3b097f255c1ffd066179d /drivers/base/bus.c | |
parent | 4ea5e9deda3f4cbd471d29e6e99106e51be19c86 (diff) | |
download | linux-6d8249ac29bc23260dfa9747eb398ce76012d73c.tar.gz linux-6d8249ac29bc23260dfa9747eb398ce76012d73c.tar.bz2 linux-6d8249ac29bc23260dfa9747eb398ce76012d73c.zip |
driver core: Fix error handling in driver API device_rename()
For class-device, device_rename() failure maybe cause unexpected link name
within its class folder as explained below:
/sys/class/.../old_name -> /sys/devices/.../old_name
device_rename(..., new_name) and failed
/sys/class/.../new_name -> /sys/devices/.../old_name
Fixed by undoing renaming link if renaming kobject failed.
Fixes: f349cf34731c ("driver core: Implement ns directory support for device classes.")
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
Link: https://lore.kernel.org/r/20240722-device_rename_fix-v2-1-77de1a6c6495@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/bus.c')
0 files changed, 0 insertions, 0 deletions