usb: Use IS_ERR_OR_NULL() instead of IS_ERR()
PATCH 1/1 usb: Use IS_ERR_OR_NULL() instead of IS_ERR()
__usb_find_phy may return NULL, so we should use IS_ERR_OR_NULL()
Signed-off-by Wang Qing <[email protected]>
--- drivers/usb/phy/phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/phy/phy.c +1 -1
@@ -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))
Signature · 1 line
2.7.4
Greg Kroah-Hartman
maintainerQuoted 1 line · Wang Qing
__usb_find_phymay return NULL, so we should useIS_ERR_OR_NULL()
Again with the subject line, "USB: phy: ..." And are you sure this function can return NULL?
thanks,
greg k-h