From: Emil Goode <emilgoode@gmail.com>
To: swhiteho@redhat.com, cluster-devel@redhat.com
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
Emil Goode <emilgoode@gmail.com>
Subject: [PATCH] GFS2: Return -ENOMEM only if kmalloc fails
Date: Thu, 26 Apr 2012 23:12:58 +0200 [thread overview]
Message-ID: <1335474778-6252-1-git-send-email-emilgoode@gmail.com> (raw)
The error variable should be assigned the value of -ENOMEM
after the NULL check and not before.
Signed-off-by: Emil Goode <emilgoode@gmail.com>
---
fs/gfs2/acl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/gfs2/acl.c b/fs/gfs2/acl.c
index 230eb0f..90f6328 100644
--- a/fs/gfs2/acl.c
+++ b/fs/gfs2/acl.c
@@ -174,8 +174,8 @@ int gfs2_acl_chmod(struct gfs2_inode *ip, struct iattr *attr)
len = posix_acl_to_xattr(acl, NULL, 0);
data = kmalloc(len, GFP_NOFS);
- error = -ENOMEM;
if (data == NULL)
+ error = -ENOMEM;
goto out;
posix_acl_to_xattr(acl, data, len);
error = gfs2_xattr_acl_chmod(ip, attr, data);
--
1.7.10
next reply other threads:[~2012-04-26 21:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-26 21:12 Emil Goode [this message]
2012-04-26 21:14 ` [PATCH] GFS2: Return -ENOMEM only if kmalloc fails Oliver Neukum
2012-04-26 21:30 ` Emil Goode
2012-04-26 21:19 ` Dave Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1335474778-6252-1-git-send-email-emilgoode@gmail.com \
--to=emilgoode@gmail.com \
--cc=cluster-devel@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=swhiteho@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).