Commit ed43d555 authored by Dan Carpenter's avatar Dan Carpenter Committed by sanglipeng
Browse files

Revert "usb: gadget: tegra-xudc: Fix error check in tegra_xudc_powerdomain_init()"

stable inclusion
from stable-v5.10.190
commit da1b105dc66d74a748bc413f1cd0c2830a9781d7
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I928UI

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=da1b105dc66d74a748bc413f1cd0c2830a9781d7



--------------------------------

commit a8291be6 upstream.

This reverts commit f08aa7c8.

The reverted commit was based on static analysis and a misunderstanding
of how PTR_ERR() and NULLs are supposed to work.  When a function
returns both pointer errors and NULL then normally the NULL means
"continue operating without a feature because it was deliberately
turned off".  The NULL should not be treated as a failure.  If a driver
cannot work when that feature is disabled then the KConfig should
enforce that the function cannot return NULL.  We should not need to
test for it.

In this driver, the bug means that probe cannot succeed when CONFIG_PM
is disabled.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Fixes: f08aa7c8 ("usb: gadget: tegra-xudc: Fix error check in tegra_xudc_powerdomain_init()")
Cc: stable <stable@kernel.org>
Link: https://lore.kernel.org/r/ZKQoBa84U/ykEh3C@moroto


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent e0b2afb6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment