summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorLinmao Li <lilinmao@kylinos.cn>2026-09-01 12:15:18 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-09-23 14:44:45 +0200
commit39eaa90b6bd1dbe147c90c345796bc042080d80e (patch)
treeb78ba7518ee5f5fa7019e36894deeefe88625d6c /tools/lib/python
parent27ca9a81485f179aac83d25fcc3234bc927fa17a (diff)
serial: 8250_mxpcie: only unregister the ports that were registered
When serial8250_register_8250_port() fails the loop stops and the probe keeps the ports registered so far, like pciserial_init_ports() in 8250_pci.c this driver was split from. What the split lost is that function's priv->nr: mxpcie8250_remove() walks all num_ports entries, but the ones the loop never reached keep the zero devm_kzalloc() left there, and the one that failed keeps a negative error code. serial8250_unregister_port() checks neither, so removal unregisters line 0 - a port this driver does not own - and indexes serial8250_ports[] with a negative line number. Record how many ports were registered and unregister only those. Fixes: 0481a041e956 ("serial: 8250: split Moxa PCIe serial board support out of 8250_pci") Signed-off-by: Linmao Li <lilinmao@kylinos.cn> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Crescent Hsieh <crescentcy.hsieh@moxa.com> Link: https://patch.msgid.link/20260901041519.114737-3-lilinmao@kylinos.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions