usb: dwc2: check return value after calling platform_get_resource()
authorYang Yingliang <yangyingliang@huawei.com>
Tue, 31 Aug 2021 08:42:36 +0000 (16:42 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 9 Oct 2021 12:40:56 +0000 (14:40 +0200)
commit2754fa3b73df7d0ae042f3ed6cfd9df9042f6262
treea25134a2ea76c2c9fe42d3bcc5e9bba0b1435335
parented6574d4846936a063940c2c7a552d0bce52dc49
usb: dwc2: check return value after calling platform_get_resource()

[ Upstream commit 856e6e8e0f9300befa87dde09edb578555c99a82 ]

It will cause null-ptr-deref if platform_get_resource() returns NULL,
we need check the return value.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210831084236.1359677-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/dwc2/hcd.c