netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: r6040: Return proper error for r6040_init_one
@ 2011-01-05  8:40 Axel Lin
  2011-01-05  9:50 ` Florian Fainelli
  0 siblings, 1 reply; 3+ messages in thread
From: Axel Lin @ 2011-01-05  8:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: Florian Fainelli, David S. Miller, netdev

Return -ENOMEM instead of 0 for the case of mdiobus_alloc and kmalloc failure.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/net/r6040.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
index 0b014c89..27e6f6d 100644
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -1153,6 +1153,7 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
 	lp->mii_bus = mdiobus_alloc();
 	if (!lp->mii_bus) {
 		dev_err(&pdev->dev, "mdiobus_alloc() failed\n");
+		err = -ENOMEM;
 		goto err_out_unmap;
 	}
 
@@ -1165,6 +1166,7 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
 	lp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
 	if (!lp->mii_bus->irq) {
 		dev_err(&pdev->dev, "mii_bus irq allocation failed\n");
+		err = -ENOMEM;
 		goto err_out_mdio;
 	}
 
-- 
1.7.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: r6040: Return proper error for r6040_init_one
  2011-01-05  8:40 [PATCH] net: r6040: Return proper error for r6040_init_one Axel Lin
@ 2011-01-05  9:50 ` Florian Fainelli
  2011-01-06 19:18   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2011-01-05  9:50 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, David S. Miller, netdev

On Wednesday 05 January 2011 09:40:04 Axel Lin wrote:
> Return -ENOMEM instead of 0 for the case of mdiobus_alloc and kmalloc
> failure.
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Acked-by: Florian Fainelli <florian@openwrt.org>

> ---
>  drivers/net/r6040.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
> index 0b014c89..27e6f6d 100644
> --- a/drivers/net/r6040.c
> +++ b/drivers/net/r6040.c
> @@ -1153,6 +1153,7 @@ static int __devinit r6040_init_one(struct pci_dev
> *pdev, lp->mii_bus = mdiobus_alloc();
>  	if (!lp->mii_bus) {
>  		dev_err(&pdev->dev, "mdiobus_alloc() failed\n");
> +		err = -ENOMEM;
>  		goto err_out_unmap;
>  	}
> 
> @@ -1165,6 +1166,7 @@ static int __devinit r6040_init_one(struct pci_dev
> *pdev, lp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
> if (!lp->mii_bus->irq) {
>  		dev_err(&pdev->dev, "mii_bus irq allocation failed\n");
> +		err = -ENOMEM;
>  		goto err_out_mdio;
>  	}

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: r6040: Return proper error for r6040_init_one
  2011-01-05  9:50 ` Florian Fainelli
@ 2011-01-06 19:18   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2011-01-06 19:18 UTC (permalink / raw)
  To: florian; +Cc: axel.lin, linux-kernel, netdev

From: Florian Fainelli <florian@openwrt.org>
Date: Wed, 5 Jan 2011 10:50:45 +0100

> On Wednesday 05 January 2011 09:40:04 Axel Lin wrote:
>> Return -ENOMEM instead of 0 for the case of mdiobus_alloc and kmalloc
>> failure.
>>
>> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> 
> Acked-by: Florian Fainelli <florian@openwrt.org>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-06 19:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-05  8:40 [PATCH] net: r6040: Return proper error for r6040_init_one Axel Lin
2011-01-05  9:50 ` Florian Fainelli
2011-01-06 19:18   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).