[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b4831521-3a80-904b-e341-978d702deb28@users.sourceforge.net>
Date: Wed, 18 Jan 2017 12:47:54 +0100
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linux-alpha@...r.kernel.org, Al Viro <viro@...iv.linux.org.uk>,
Ivan Kokshaysky <ink@...assic.park.msu.ru>,
Jan-Benedict Glaw <jbglaw@...-owl.de>,
Matt Turner <mattst88@...il.com>,
Nicolas Pitre <nicolas.pitre@...aro.org>,
Richard Cochran <richardcochran@...il.com>,
Richard Henderson <rth@...ddle.net>,
Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH 3/4] alpha: Return directly after a failed copy_from_user() or
getname() in two functions
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Wed, 18 Jan 2017 11:30:06 +0100
Return directly after a call of the function "copy_from_user" or "getname"
failed at the beginning.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
arch/alpha/kernel/osf_sys.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index 73ff5d698591..4310bc79d09c 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -454,16 +454,13 @@ osf_ufs_mount(const char __user *dirname,
struct cdfs_args tmp;
struct filename *devname;
- retval = -EFAULT;
if (copy_from_user(&tmp, args, sizeof(tmp)))
- goto out;
+ return -EFAULT;
devname = getname(tmp.devname);
- retval = PTR_ERR(devname);
if (IS_ERR(devname))
- goto out;
+ return PTR_ERR(devname);
retval = do_mount(devname->name, dirname, "ext2", flags, NULL);
putname(devname);
- out:
return retval;
}
@@ -475,16 +472,13 @@ osf_cdfs_mount(const char __user *dirname,
struct cdfs_args tmp;
struct filename *devname;
- retval = -EFAULT;
if (copy_from_user(&tmp, args, sizeof(tmp)))
- goto out;
+ return -EFAULT;
devname = getname(tmp.devname);
- retval = PTR_ERR(devname);
if (IS_ERR(devname))
- goto out;
+ return PTR_ERR(devname);
retval = do_mount(devname->name, dirname, "iso9660", flags, NULL);
putname(devname);
- out:
return retval;
}
--
2.11.0
Powered by blists - more mailing lists