netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bonding: bond_open error return value
@ 2010-01-26  9:34 Stephen Hemminger
  2010-01-28 13:58 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2010-01-26  9:34 UTC (permalink / raw)
  To: Jay Vosburgh; +Cc: bonding-devel, netdev

The convention for API functions in kernel is to return errno value;
bond_open would return -1 if alb setup failed. The only reason that
could happen is if kmalloc() failed.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--- a/drivers/net/bonding/bond_main.c	2010-01-26 01:28:18.281568331 -0800
+++ b/drivers/net/bonding/bond_main.c	2010-01-26 01:29:58.101099312 -0800
@@ -3650,7 +3650,7 @@ static int bond_open(struct net_device *
 		 */
 		if (bond_alb_initialize(bond, (bond->params.mode == BOND_MODE_ALB))) {
 			/* something went wrong - fail the open operation */
-			return -1;
+			return -ENOMEM;
 		}
 
 		INIT_DELAYED_WORK(&bond->alb_work, bond_alb_monitor);

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

* Re: [PATCH] bonding: bond_open error return value
  2010-01-26  9:34 [PATCH] bonding: bond_open error return value Stephen Hemminger
@ 2010-01-28 13:58 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-01-28 13:58 UTC (permalink / raw)
  To: shemminger; +Cc: fubar, bonding-devel, netdev

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Tue, 26 Jan 2010 01:34:15 -0800

> The convention for API functions in kernel is to return errno value;
> bond_open would return -1 if alb setup failed. The only reason that
> could happen is if kmalloc() failed.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Applied.

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

end of thread, other threads:[~2010-01-28 13:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-26  9:34 [PATCH] bonding: bond_open error return value Stephen Hemminger
2010-01-28 13:58 ` 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).