usb: host: ohci-tmio: check return value after calling platform_get_resource()
authorYang Yingliang <yangyingliang@huawei.com>
Mon, 11 Oct 2021 13:49:20 +0000 (21:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Nov 2021 09:39:10 +0000 (10:39 +0100)
commit2474eb7fc3bfbce10f7b8ea431fcffe5dd5f5100
treef16dbdeee4bcdadf49385103beebda9938bf3f4e
parent02d9ebe0ccfaf9d2a49496bee05752ad00114838
usb: host: ohci-tmio: check return value after calling platform_get_resource()

[ Upstream commit 9eff2b2e59fda25051ab36cd1cb5014661df657b ]

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

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20211011134920.118477-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/host/ohci-tmio.c