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 <[email protected]>
---

 drivers/scsi/fcoe/fcoe.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index e6f7bf2..3f054a7 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -228,6 +228,7 @@ static void fcoe_interface_destroy_work(struct work_struct 
*work);
 static struct fcoe_interface *fcoe_interface_create(struct net_device *netdev)
 {
        struct fcoe_interface *fcoe;
+       int err;
 
        fcoe = kzalloc(sizeof(*fcoe), GFP_KERNEL);
        if (!fcoe) {
@@ -246,7 +247,14 @@ static struct fcoe_interface *fcoe_interface_create(struct 
net_device *netdev)
        fcoe->ctlr.send = fcoe_fip_send;
        fcoe->ctlr.update_mac = fcoe_update_src_mac;
 
-       fcoe_interface_setup(fcoe, netdev);
+       err = fcoe_interface_setup(fcoe, netdev);
+       if (err) {
+               FCOE_NETDEV_DBG(netdev, "Bonded interfaces not supported\n");
+               fcoe_ctlr_destroy(&fcoe->ctlr);
+               kfree(fcoe);
+               dev_put(netdev);
+               return NULL;
+       }
 
        return fcoe;
 }

_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel

Reply via email to