lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210412162804.1628738-1-colin.king@canonical.com>
Date:   Mon, 12 Apr 2021 17:28:04 +0100
From:   Colin King <colin.king@...onical.com>
To:     "Michael S . Tsirkin" <mst@...hat.com>,
        Jason Wang <jasowang@...hat.com>,
        Parav Pandit <parav@...dia.com>,
        virtualization@...ts.linux-foundation.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH][next] vdpa/mlx5: Fix resource leak of mgtdev due to incorrect kfree

From: Colin Ian King <colin.king@...onical.com>

Static analysis is reporting a memory leak on mgtdev, it appears
that the wrong object is being kfree'd. Fix this by kfree'ing
mgtdev rather than mdev.

Addresses-Coverity: ("Resource leak")
Fixes: c8a2d4c73e70 ("vdpa/mlx5: Enable user to add/delete vdpa device")
Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
 drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
index 10c5fef3c020..25533db01f5f 100644
--- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
+++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
@@ -2089,7 +2089,7 @@ static int mlx5v_probe(struct auxiliary_device *adev,
 	return 0;
 
 reg_err:
-	kfree(mdev);
+	kfree(mgtdev);
 	return err;
 }
 
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ