aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fcoe
diff options
context:
space:
mode:
authorjohn fastabend <john.r.fastabend@intel.com>2009-11-03 14:48:44 -0500
committerJames Bottomley <James.Bottomley@suse.de>2009-12-04 13:01:15 -0500
commit59d925168457805572f40fb12bd399e89775b3ff (patch)
treeca5455d57867826c44dcf5ad4d20f502f8dbeed3 /drivers/scsi/fcoe
parent4e5ad003ae07999593bb58ffb7ea646700647390 (diff)
[SCSI] fcoe: add check to fail gracefully in bonding mode
This patch adds a check to fail gracefully when the netdevice is bonded. Previously, the error was detected but the stack would continue to load. This resulted in a partially enabled fcoe intance and errors when the fcoe instance was destroy. Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/fcoe')
-rw-r--r--drivers/scsi/fcoe/fcoe.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 17ce2efc3c19..b15ec996b477 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -266,6 +266,7 @@ static int fcoe_interface_setup(struct fcoe_interface *fcoe,
266 if ((netdev->priv_flags & IFF_MASTER_ALB) || 266 if ((netdev->priv_flags & IFF_MASTER_ALB) ||
267 (netdev->priv_flags & IFF_SLAVE_INACTIVE) || 267 (netdev->priv_flags & IFF_SLAVE_INACTIVE) ||
268 (netdev->priv_flags & IFF_MASTER_8023AD)) { 268 (netdev->priv_flags & IFF_MASTER_8023AD)) {
269 FCOE_NETDEV_DBG(netdev, "Bonded interfaces not supported\n");
269 return -EOPNOTSUPP; 270 return -EOPNOTSUPP;
270 } 271 }
271 272
@@ -323,6 +324,7 @@ static int fcoe_interface_setup(struct fcoe_interface *fcoe,
323static struct fcoe_interface *fcoe_interface_create(struct net_device *netdev) 324static struct fcoe_interface *fcoe_interface_create(struct net_device *netdev)
324{ 325{
325 struct fcoe_interface *fcoe; 326 struct fcoe_interface *fcoe;
327 int err;
326 328
327 fcoe = kzalloc(sizeof(*fcoe), GFP_KERNEL); 329 fcoe = kzalloc(sizeof(*fcoe), GFP_KERNEL);
328 if (!fcoe) { 330 if (!fcoe) {
@@ -341,7 +343,13 @@ static struct fcoe_interface *fcoe_interface_create(struct net_device *netdev)
341 fcoe->ctlr.update_mac = fcoe_update_src_mac; 343 fcoe->ctlr.update_mac = fcoe_update_src_mac;
342 fcoe->ctlr.get_src_addr = fcoe_get_src_mac; 344 fcoe->ctlr.get_src_addr = fcoe_get_src_mac;
343 345
344 fcoe_interface_setup(fcoe, netdev); 346 err = fcoe_interface_setup(fcoe, netdev);
347 if (err) {
348 fcoe_ctlr_destroy(&fcoe->ctlr);
349 kfree(fcoe);
350 dev_put(netdev);
351 return NULL;
352 }
345 353
346 return fcoe; 354 return fcoe;
347} 355}