Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 28 Oct 2010 01:28:00 +0000 (18:28 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 28 Oct 2010 01:28:00 +0000 (18:28 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (108 commits)
  ehea: Fixing statistics
  bonding: Fix lockdep warning after bond_vlan_rx_register()
  tunnels: Fix tunnels change rcu protection
  caif-u5500: Build config for CAIF shared mem driver
  caif-u5500: CAIF shared memory mailbox interface
  caif-u5500: CAIF shared memory transport protocol
  caif-u5500: Adding shared memory include
  drivers/isdn: delete double assignment
  drivers/net/typhoon.c: delete double assignment
  drivers/net/sb1000.c: delete double assignment
  qlcnic: define valid vlan id range
  qlcnic: reduce rx ring size
  qlcnic: fix mac learning
  ehea: fix use after free
  inetpeer: __rcu annotations
  fib_rules: __rcu annotates ctarget
  tunnels: add __rcu annotations
  net: add __rcu annotations to protocol
  ipv4: add __rcu annotations to routes.c
  qlge: bugfix: Restoring the vlan setting.
  ...

1  2 
drivers/net/mlx4/port.c

diff --combined drivers/net/mlx4/port.c
index 56371ef328efebec61d170de0d9cc569dcbd5913,8674ad5764c4a7660a9b98ab4f2a11a7e9acb684..451339559bdc16bd64e07e124850f5280ef02b3d
@@@ -111,6 -111,12 +111,12 @@@ int mlx4_register_mac(struct mlx4_dev *
                        goto out;
                }
        }
+       if (free < 0) {
+               err = -ENOMEM;
+               goto out;
+       }
        mlx4_dbg(dev, "Free MAC index is %d\n", free);
  
        if (table->total == table->max) {
@@@ -182,25 -188,6 +188,25 @@@ static int mlx4_set_port_vlan_table(str
        return err;
  }
  
 +int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx)
 +{
 +      struct mlx4_vlan_table *table = &mlx4_priv(dev)->port[port].vlan_table;
 +      int i;
 +
 +      for (i = 0; i < MLX4_MAX_VLAN_NUM; ++i) {
 +              if (table->refs[i] &&
 +                  (vid == (MLX4_VLAN_MASK &
 +                            be32_to_cpu(table->entries[i])))) {
 +                      /* VLAN already registered, increase reference count */
 +                      *idx = i;
 +                      return 0;
 +              }
 +      }
 +
 +      return -ENOENT;
 +}
 +EXPORT_SYMBOL_GPL(mlx4_find_cached_vlan);
 +
  int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index)
  {
        struct mlx4_vlan_table *table = &mlx4_priv(dev)->port[port].vlan_table;
                }
        }
  
+       if (free < 0) {
+               err = -ENOMEM;
+               goto out;
+       }
        if (table->total == table->max) {
                /* No free vlan entries */
                err = -ENOSPC;