]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: core: hcd: Fix return value check in usb_hcd_setup_local_mem()
authorYang Yingliang <yangyingliang@huawei.com>
Fri, 25 Nov 2022 06:41:20 +0000 (14:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:26:27 +0000 (13:26 +0100)
commitddddd0be449420d8e6242be1cd6e6cbb56b9d7cc
treeab648047fae7c3d002259a88a42e9b94434625f0
parentb67cb0cce5024c47d8b1acc3a0fd786cb2cc8f25
usb: core: hcd: Fix return value check in usb_hcd_setup_local_mem()

[ Upstream commit 3c347cdafa3db43337870006e5c2d7b78a8dae20 ]

If dmam_alloc_attrs() fails, it returns NULL pointer and never
return ERR_PTR(), so repleace IS_ERR() with IS_ERR_OR_NULL()
and if it's NULL, returns -ENOMEM.

Fixes: 9ba26f5cecd8 ("ARM: sa1100/assabet: move dmabounce hack to ohci driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20221125064120.2842452-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/core/hcd.c