提交 80f46d5d 编写于 作者: A Aaro Koskinen 提交者: Felipe Balbi

usb: phy: tahvo: fix smatch warnings

phy-tahvo introduced the following smatch warnings:

drivers/usb/phy/phy-tahvo.c:203 tahvo_usb_set_host() warn: variable dereferenced before check 'otg' (see line 199)
drivers/usb/phy/phy-tahvo.c:235 tahvo_usb_set_peripheral() warn: variable dereferenced before check 'otg' (see line 231)

Fix by deleting bogus NULL pointer checks. The USB framework will always
call us with a valid OTG pointer.
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 2ee8ff30
...@@ -200,9 +200,6 @@ static int tahvo_usb_set_host(struct usb_otg *otg, struct usb_bus *host) ...@@ -200,9 +200,6 @@ static int tahvo_usb_set_host(struct usb_otg *otg, struct usb_bus *host)
dev_dbg(&tu->pt_dev->dev, "%s %p\n", __func__, host); dev_dbg(&tu->pt_dev->dev, "%s %p\n", __func__, host);
if (otg == NULL)
return -ENODEV;
mutex_lock(&tu->serialize); mutex_lock(&tu->serialize);
if (host == NULL) { if (host == NULL) {
...@@ -232,9 +229,6 @@ static int tahvo_usb_set_peripheral(struct usb_otg *otg, ...@@ -232,9 +229,6 @@ static int tahvo_usb_set_peripheral(struct usb_otg *otg,
dev_dbg(&tu->pt_dev->dev, "%s %p\n", __func__, gadget); dev_dbg(&tu->pt_dev->dev, "%s %p\n", __func__, gadget);
if (!otg)
return -ENODEV;
mutex_lock(&tu->serialize); mutex_lock(&tu->serialize);
if (!gadget) { if (!gadget) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册