Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: host: ohci-tmio: check return value after calling platform_get_resource()

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>

authored by

Yang Yingliang and committed by
Greg Kroah-Hartman
9eff2b2e 6fec018a

+1 -1
+1 -1
drivers/usb/host/ohci-tmio.c
··· 199 199 if (usb_disabled()) 200 200 return -ENODEV; 201 201 202 - if (!cell) 202 + if (!cell || !regs || !config || !sram) 203 203 return -EINVAL; 204 204 205 205 if (irq < 0)