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>] [day] [month] [year] [list]
Message-ID: <c95bd00e-ae0f-4f52-b853-a92ae3cb150f@web.de>
Date: Tue, 7 Oct 2025 18:38:11 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: linux-cifs@...r.kernel.org, samba-technical@...ts.samba.org,
 Aurelien Aptel <aaptel@...e.com>, Bharath SM <bharathsm@...rosoft.com>,
 Paulo Alcantara <pc@...guebit.org>,
 Ronnie Sahlberg <ronniesahlberg@...il.com>, Samuel Cabrero
 <scabrero@...e.de>, Shyam Prasad N <sprasad@...rosoft.com>,
 Steve French <sfrench@...ba.org>, Tom Talpey <tom@...pey.com>
Cc: LKML <linux-kernel@...r.kernel.org>, kernel-janitors@...r.kernel.org
Subject: [PATCH] smb: client: Return directly after a failed genlmsg_new() in
 cifs_swn_send_register_message()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Tue, 7 Oct 2025 18:25:27 +0200
Subject: [PATCH] smb: client: Return directly after a failed genlmsg_new() in cifs_swn_send_register_message()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* Return directly after a call of the function “genlmsg_new” failed
  at the beginning.

* Delete the label “fail” which became unnecessary
  with this refactoring.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 fs/smb/client/cifs_swn.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/smb/client/cifs_swn.c b/fs/smb/client/cifs_swn.c
index 7233c6a7e6d7..9ac80ca6d06f 100644
--- a/fs/smb/client/cifs_swn.c
+++ b/fs/smb/client/cifs_swn.c
@@ -82,10 +82,8 @@ static int cifs_swn_send_register_message(struct cifs_swn_reg *swnreg)
 	int ret;
 
 	skb = genlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
-	if (skb == NULL) {
-		ret = -ENOMEM;
-		goto fail;
-	}
+	if (!skb)
+		return -ENOMEM;
 
 	hdr = genlmsg_put(skb, 0, 0, &cifs_genl_family, 0, CIFS_GENL_CMD_SWN_REGISTER);
 	if (hdr == NULL) {
@@ -172,7 +170,6 @@ static int cifs_swn_send_register_message(struct cifs_swn_reg *swnreg)
 nlmsg_fail:
 	genlmsg_cancel(skb, hdr);
 	nlmsg_free(skb);
-fail:
 	return ret;
 }
 
-- 
2.51.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ