浏览代码

net/mlx4_core: Free ICM table in case of error

In mlx4_init_icm_table(), free the allocated table if we failed to
allocate memory to its entries.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Dotan Barak 13 年之前
父节点
当前提交
240a9207aa
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      drivers/net/ethernet/mellanox/mlx4/icm.c

+ 2 - 0
drivers/net/ethernet/mellanox/mlx4/icm.c

@@ -413,6 +413,8 @@ err:
 			mlx4_free_icm(dev, table->icm[i], use_coherent);
 		}
 
+	kfree(table->icm);
+
 	return -ENOMEM;
 }