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-prev] [day] [month] [year] [list]
Message-ID: <20240820012718.4121485-2-lizetao1@huawei.com>
Date: Tue, 20 Aug 2024 09:27:18 +0800
From: Li Zetao <lizetao1@...wei.com>
To: <kent.overstreet@...ux.dev>
CC: <lizetao1@...wei.com>, <linux-bcachefs@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
Subject: [PATCH -next 2/2] bcachefs: Remove redundant check before free in bch2_ioctl_disk_add()

Since the variable path has been checked after strndup_user() and
will not be reassigned during use, so it does not need to be checked
again before free.

No functional change intended.

Signed-off-by: Li Zetao <lizetao1@...wei.com>
---
 fs/bcachefs/chardev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/bcachefs/chardev.c b/fs/bcachefs/chardev.c
index c315421bee85..ea84aaa7a143 100644
--- a/fs/bcachefs/chardev.c
+++ b/fs/bcachefs/chardev.c
@@ -320,8 +320,7 @@ static long bch2_ioctl_disk_add(struct bch_fs *c, struct bch_ioctl_disk arg)
 		return PTR_ERR(path);
 
 	ret = bch2_dev_add(c, path);
-	if (!IS_ERR(path))
-		kfree(path);
+	kfree(path);
 
 	return ret;
 }
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ