Browse Source

mlx4_core: Fix memory leak in mlx4_enable_msi_x()

When the msi_x option is enabled but pci_enable_msix() fails (not
enough vectors are available etc), the entries array was not freed on
the error path.

Signed-off-by: Nicolas Morey-Chaisemartin <nicolas.morey-chaisemartin@ext.bull.net>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Nicolas Morey-Chaisemartin 16 years ago
parent
commit
5bf0da7dd0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/net/mlx4/main.c

+ 1 - 1
drivers/net/mlx4/main.c

@@ -976,7 +976,7 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev)
 				nreq = err;
 				nreq = err;
 				goto retry;
 				goto retry;
 			}
 			}
-
+			kfree(entries);
 			goto no_msi;
 			goto no_msi;
 		}
 		}