]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: chipidea: ci_hdrc_imx: fix usbmisc handling
authorFedor Pchelkin <pchelkin@ispras.ru>
Sun, 16 Mar 2025 10:26:54 +0000 (13:26 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:46:59 +0000 (07:46 +0200)
commit0ee460498ced49196149197c9f6d29a10e5e0798
treee9890e11cae0473d2baee229f10b0f2ef5057c2d
parentc27db84ed44e50ff90d9e3a2a25fae2e0a0fa015
usb: chipidea: ci_hdrc_imx: fix usbmisc handling

commit 4e28f79e3dffa52d327b46d1a78dac16efb5810b upstream.

usbmisc is an optional device property so it is totally valid for the
corresponding data->usbmisc_data to have a NULL value.

Check that before dereferencing the pointer.

Found by Linux Verification Center (linuxtesting.org) with Svace static
analysis tool.

Fixes: 74adad500346 ("usb: chipidea: ci_hdrc_imx: decrement device's refcount in .remove() and in the error path of .probe()")
Cc: stable <stable@kernel.org>
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Acked-by: Peter Chen <peter.chen@kernel.org>
Link: https://lore.kernel.org/r/20250316102658.490340-2-pchelkin@ispras.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/chipidea/ci_hdrc_imx.c