* [PATCH] usb: Use IS_ERR_OR_NULL() instead of IS_ERR()
@ 2020-11-06 3:31 Wang Qing
2020-11-06 6:52 ` Greg Kroah-Hartman
0 siblings, 1 reply; 2+ messages in thread
From: Wang Qing @ 2020-11-06 3:31 UTC (permalink / raw
To: Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-kernel; +Cc: Wang Qing
__usb_find_phy may return NULL, so we should use IS_ERR_OR_NULL()
Signed-off-by: Wang Qing <wangqing@vivo.com>
---
drivers/usb/phy/phy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c
index de21967..60c5ea4 100755
--- a/drivers/usb/phy/phy.c
+++ b/drivers/usb/phy/phy.c
@@ -460,7 +460,7 @@ struct usb_phy *usb_get_phy(enum usb_phy_type type)
spin_lock_irqsave(&phy_lock, flags);
phy = __usb_find_phy(&phy_list, type);
- if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) {
+ if (IS_ERR_OR_NULL(phy) || !try_module_get(phy->dev->driver->owner)) {
pr_debug("PHY: unable to find transceiver of type %s\n",
usb_phy_type_string(type));
if (!IS_ERR(phy))
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] usb: Use IS_ERR_OR_NULL() instead of IS_ERR()
2020-11-06 3:31 [PATCH] usb: Use IS_ERR_OR_NULL() instead of IS_ERR() Wang Qing
@ 2020-11-06 6:52 ` Greg Kroah-Hartman
0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2020-11-06 6:52 UTC (permalink / raw
To: Wang Qing; +Cc: Felipe Balbi, linux-usb, linux-kernel
On Fri, Nov 06, 2020 at 11:31:18AM +0800, Wang Qing wrote:
> __usb_find_phy may return NULL, so we should use IS_ERR_OR_NULL()
Again with the subject line, "USB: phy: ..." And are you sure this
function can return NULL?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-06 6:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-06 3:31 [PATCH] usb: Use IS_ERR_OR_NULL() instead of IS_ERR() Wang Qing
2020-11-06 6:52 ` Greg Kroah-Hartman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.