提交 7f4d1e7b 编写于 作者: G Gabor Juhos 提交者: Felipe Balbi

usb: phy: don't return with NULL from devm_usb_get_phy()

The callers are expecting an ERR_PTR value in case
of an error. Change he code to return with an encoded
-ENOMEM value in the case of a failed devres_alloc call.
Signed-off-by: NGabor Juhos <juhosg@openwrt.org>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 cd108691
......@@ -98,7 +98,7 @@ struct usb_phy *devm_usb_get_phy(struct device *dev, enum usb_phy_type type)
ptr = devres_alloc(devm_usb_phy_release, sizeof(*ptr), GFP_KERNEL);
if (!ptr)
return NULL;
return ERR_PTR(-ENOMEM);
phy = usb_get_phy(type);
if (!IS_ERR(phy)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册