]> git.ipfire.org Git - thirdparty/linux.git/commit
serial: Fix potential null-ptr-deref in mlb_usio_probe()
authorHenry Martin <bsdhenrymartin@gmail.com>
Thu, 3 Apr 2025 07:03:39 +0000 (15:03 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Apr 2025 14:53:34 +0000 (16:53 +0200)
commit86bcae88c9209e334b2f8c252f4cc66beb261886
treecb12af62a9297f2358d1e001ad5fb22d3622a88f
parent81e4de4ba298d73fce72c70eddeb86b151640c27
serial: Fix potential null-ptr-deref in mlb_usio_probe()

devm_ioremap() can return NULL on error. Currently, mlb_usio_probe()
does not check for this case, which could result in a NULL pointer
dereference.

Add NULL check after devm_ioremap() to prevent this issue.

Fixes: ba44dc043004 ("serial: Add Milbeaut serial control")
Signed-off-by: Henry Martin <bsdhenrymartin@gmail.com>
Link: https://lore.kernel.org/r/20250403070339.64990-1-bsdhenrymartin@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/milbeaut_usio.c