commit f7e1b66a194e38f9fa41f8144aa34b782fb4f53a
Author: Jay Vosburgh <[EMAIL PROTECTED]>
Date:   Fri Feb 15 10:00:41 2008 -0800

    bonding: fix NULL pointer deref in startup processing
    
    patch 4fe4763cd8cacd81d892193efb48b99c99c15323 in mainline.
    
        Fix the "are we creating a duplicate" check to not compare
    the name if the name is NULL (meaning that the system should select
    a name).  Bug reported by Benny Amorsen <[EMAIL PROTECTED]>.
    
    Signed-off-by: Jay Vosburgh <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 49a1982..75efa8b 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4883,14 +4883,16 @@ int bond_create(char *name, struct bond_params *params, 
struct bonding **newbond
        down_write(&bonding_rwsem);
 
        /* Check to see if the bond already exists. */
-       list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list)
-               if (strnicmp(bond->dev->name, name, IFNAMSIZ) == 0) {
-                       printk(KERN_ERR DRV_NAME
+       if (name) {
+               list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list)
+                       if (strnicmp(bond->dev->name, name, IFNAMSIZ) == 0) {
+                               printk(KERN_ERR DRV_NAME
                               ": cannot add bond %s; it already exists\n",
-                              name);
-                       res = -EPERM;
-                       goto out_rtnl;
-               }
+                                      name);
+                               res = -EPERM;
+                               goto out_rtnl;
+                       }
+       }
 
        bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "",
                                ether_setup);
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to