From: Roel Kluin <roel.kluin@gmail.com>
To: paulius.zaleckas@teltonika.lt, "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH] phylib: unsigneds go unnoticed
Date: Sun, 18 Jan 2009 23:57:43 +0100 [thread overview]
Message-ID: <4973B3E7.6080203@gmail.com> (raw)
both pdata->mdc and pdata->mdio are unsigned. Notice a negative
return value.
diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c
index a439ebe..9b1dcd6 100644
--- a/drivers/net/phy/mdio-gpio.c
+++ b/drivers/net/phy/mdio-gpio.c
@@ -200,13 +200,21 @@ static int __devinit mdio_ofgpio_probe(struct of_device *ofdev,
{
struct device_node *np = NULL;
struct mdio_gpio_platform_data *pdata;
+ int ret;
pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
if (!pdata)
return -ENOMEM;
- pdata->mdc = of_get_gpio(ofdev->node, 0);
- pdata->mdio = of_get_gpio(ofdev->node, 1);
+ ret = of_get_gpio(ofdev->node, 0);
+ if (ret < 0)
+ goto out_free;
+ pdata->mdc = ret;
+
+ ret = of_get_gpio(ofdev->node, 1);
+ if (ret < 0)
+ goto out_free;
+ pdata->mdio = ret;
if (pdata->mdc < 0 || pdata->mdio < 0)
goto out_free;
next reply other threads:[~2009-01-18 23:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-18 22:57 Roel Kluin [this message]
2009-01-19 5:25 ` [PATCH] phylib: unsigneds go unnoticed David Miller
2009-01-19 9:41 ` Roel Kluin
2009-01-20 1:14 ` David Miller
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=4973B3E7.6080203@gmail.com \
--to=roel.kluin@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=paulius.zaleckas@teltonika.lt \
/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.