usb: gadget: r8a66597: Add missing null check on return from platform_get_resource
stable inclusion from stable-5.10.37 commit e38a77c48aa02e0d58a366466c430b8fd9efb887 bugzilla: 51868 CVE: NA -------------------------------- [ Upstream commit 9c207609 ] The call to platform_get_resource can potentially return a NULL pointer on failure, so add this check and return -EINVAL if it fails. Fixes: c4144247 ("usb: gadget: R8A66597 peripheral controller support.") Signed-off-by: NColin Ian King <colin.king@canonical.com> Addresses-Coverity: ("Dereference null return") Link: https://lore.kernel.org/r/20210406184510.433497-1-colin.king@canonical.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NChen Jun <chenjun102@huawei.com> Acked-by: NWeilong Chen <chenweilong@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Showing
想要评论请 注册 或 登录