]> git.ipfire.org Git - thirdparty/kernel/stable.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, 27 Jun 2025 10:07:16 +0000 (11:07 +0100)
commit548b0e81b9a0902a8bc8259430ed965663baadfc
tree942fad785ce8ec174a0f2c9c6c2371fc00f8d012
parent1637623ad6205162b17804d07512e6f4cbd2a050
serial: Fix potential null-ptr-deref in mlb_usio_probe()

[ Upstream commit 86bcae88c9209e334b2f8c252f4cc66beb261886 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/serial/milbeaut_usio.c