diff options
| author | Myeonghun Pak <mhun512@gmail.com> | 2026-09-10 23:15:00 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-09-23 14:45:16 +0200 |
| commit | c5b33c86d86da3ccff8c05e2a28719e3ec933f70 (patch) | |
| tree | a0d5ebb6f95ce889ebf3dcaf082a1169b329e4b0 /tools/perf/scripts/python | |
| parent | 9598f73f14bb2a1d4e8fcc38c108c005f23dc4fe (diff) | |
| download | linux-next-c5b33c86d86da3ccff8c05e2a28719e3ec933f70.tar.gz linux-next-c5b33c86d86da3ccff8c05e2a28719e3ec933f70.zip | |
serial: sh-sci: Unregister UART on sysfs setup failure
sci_probe_single() registers the UART port before sci_probe() creates
the RX FIFO tuning attributes. If either device_create_file() call
fails, probe returns an error without removing the port from the serial
core. Device-managed resources are then released while the port remains
registered.
Unregister the UART port before returning either sysfs creation error.
If the second attribute fails, remove the first attribute before
unregistering the port. Keep the existing probe failure policy and leave
the successful initialization path unchanged.
This issue was identified during our ongoing static-analysis research while
reviewing kernel code.
Fixes: 5d23188a473d ("serial: sh-sci: make RX FIFO parameters tunable via sysfs")
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Link: https://patch.msgid.link/20260911031500.5745-1-mhun512@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
