]> www.infradead.org Git - users/hch/misc.git/commitdiff
smb: client: Return directly after a failed genlmsg_new() in cifs_swn_send_register_m...
authorMarkus Elfring <elfring@users.sourceforge.net>
Tue, 7 Oct 2025 16:25:27 +0000 (18:25 +0200)
committerSteve French <stfrench@microsoft.com>
Tue, 7 Oct 2025 19:28:16 +0000 (14:28 -0500)
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@users.sourceforge.net>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cifs_swn.c

index 35a3e73c1958062db6d68759eb0b0477fad26ab9..68a1f87c446d04f5c9b5e7202b47e34dee21b932 100644 (file)
@@ -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;
 }