]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
net/mlx4_en: fix a memory leak bug
authorWenwen Wang <wenwen@cs.uga.edu>
Mon, 12 Aug 2019 19:11:35 +0000 (14:11 -0500)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 17 Sep 2019 16:02:18 +0000 (18:02 +0200)
commit9bfa899836c771a349ecaa00bbfceb744666a06f
tree2efe9929aa0d71a2e27fe789f2b7ecd4748690bc
parentc99ec777f296be641c9afb0bb3dee0aa634854e2
net/mlx4_en: fix a memory leak bug

BugLink: https://bugs.launchpad.net/bugs/1841652
[ Upstream commit 48ec7014c56e5eb2fbf6f479896143622d834f3b ]

In mlx4_en_config_rss_steer(), 'rss_map->indir_qp' is allocated through
kzalloc(). After that, mlx4_qp_alloc() is invoked to configure RSS
indirection. However, if mlx4_qp_alloc() fails, the allocated
'rss_map->indir_qp' is not deallocated, leading to a memory leak bug.

To fix the above issue, add the 'qp_alloc_err' label to free
'rss_map->indir_qp'.

Fixes: 4931c6ef04b4 ("net/mlx4_en: Optimized single ring steering")
Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/ethernet/mellanox/mlx4/en_rx.c