net/mlx4: fix small memory leak on error
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 3 Jul 2013 09:37:46 +0000 (12:37 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 3 Jul 2013 23:52:10 +0000 (16:52 -0700)
"work" needs to be freed before returning on this error path.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/cmd.c

index 707a7d0..299d018 100644 (file)
@@ -1572,6 +1572,7 @@ int mlx4_master_immediate_activate_vlan_qos(struct mlx4_priv *priv,
                                           vp_admin->default_vlan,
                                           &admin_vlan_ix);
                if (err) {
+                       kfree(work);
                        mlx4_warn((&priv->dev),
                                  "No vlan resources slave %d, port %d\n",
                                  slave, port);