From: Arjun Sreedharan <arjun024@gmail.com>
To: balbi@ti.com
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] usb: phy: return -ENODEV on failure of try_module_get
Date: Mon, 18 Aug 2014 00:04:42 +0530 [thread overview]
Message-ID: <1408300482-1667-1-git-send-email-arjun024@gmail.com> (raw)
When __usb_find_phy_dev() does not return error and
try_module_get() fails, return -ENODEV
Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
---
drivers/usb/phy/phy.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c
index 36b6bce..8ad3638 100644
--- a/drivers/usb/phy/phy.c
+++ b/drivers/usb/phy/phy.c
@@ -232,6 +232,7 @@ struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index)
phy = __usb_find_phy_dev(dev, &phy_bind_list, index);
if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) {
dev_dbg(dev, "unable to find transceiver\n");
+ phy = IS_ERR(phy) ? phy : ERR_PTR(-ENODEV);
goto err0;
}
--
1.7.11.7
next reply other threads:[~2014-08-17 18:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-17 18:34 Arjun Sreedharan [this message]
2014-08-18 1:59 ` [PATCH] usb: phy: return -ENODEV on failure of try_module_get Greg KH
2014-08-18 5:47 ` Arjun Sreedharan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1408300482-1667-1-git-send-email-arjun024@gmail.com \
--to=arjun024@gmail.com \
--cc=balbi@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.