Skip to content

Commit 4468490

Browse files
elfringsmfrench
authored andcommitted
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@users.sourceforge.net> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent ce47f74 commit 4468490

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

fs/smb/client/cifs_swn.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,8 @@ static int cifs_swn_send_register_message(struct cifs_swn_reg *swnreg)
8282
int ret;
8383

8484
skb = genlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
85-
if (skb == NULL) {
86-
ret = -ENOMEM;
87-
goto fail;
88-
}
85+
if (!skb)
86+
return -ENOMEM;
8987

9088
hdr = genlmsg_put(skb, 0, 0, &cifs_genl_family, 0, CIFS_GENL_CMD_SWN_REGISTER);
9189
if (hdr == NULL) {
@@ -172,7 +170,6 @@ static int cifs_swn_send_register_message(struct cifs_swn_reg *swnreg)
172170
nlmsg_fail:
173171
genlmsg_cancel(skb, hdr);
174172
nlmsg_free(skb);
175-
fail:
176173
return ret;
177174
}
178175

0 commit comments

Comments
 (0)