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] [thread-next>] [day] [month] [year] [list]
Message-ID: <cb83ea97-f6f8-9f07-0eba-dd338557e716@users.sourceforge.net>
Date:   Sun, 20 Aug 2017 18:38:04 +0200
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     linux-cifs@...r.kernel.org, samba-technical@...ts.samba.org,
        Steve French <sfrench@...ba.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: [PATCH 4/8] CIFS: Use common error handling code in cifs_mknod()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sun, 20 Aug 2017 16:30:06 +0200

Add a jump target so that a bit of exception handling can be better reused
in this function.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 fs/cifs/dir.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index b43e535ced8a..41039ab12643 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -687,8 +687,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
 	if (buf == NULL) {
 		kfree(full_path);
 		rc = -ENOMEM;
-		free_xid(xid);
-		return rc;
+		goto free_id;
 	}
 
 	if (backup_cred(cifs_sb))
@@ -744,8 +743,9 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
 mknod_out:
 	kfree(full_path);
 	kfree(buf);
-	free_xid(xid);
 	cifs_put_tlink(tlink);
+free_id:
+	free_xid(xid);
 	return rc;
 }
 
-- 
2.14.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ