summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorSeth Forshee <seth.forshee@canonical.com>2016-05-05 10:52:38 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-06-07 18:18:53 -0700
commit2d337f81f01db9f7c9ea385f76ac536e9074cb87 (patch)
tree11f072331ebb602fe016d3fa4c7a78fb6d788ff3 /fs
parentfdfcb7deb2c4a0cfcaa5a9b9bffd95faa0f43b49 (diff)
downloadlwn-2d337f81f01db9f7c9ea385f76ac536e9074cb87.tar.gz
lwn-2d337f81f01db9f7c9ea385f76ac536e9074cb87.zip
ext4: fix check of dqget() return value in ext4_ioctl_setproject()
commit ff0bc08454917964291f72ee5b8eca66de4bc250 upstream. A failed call to dqget() returns an ERR_PTR() and not null. Fix the check in ext4_ioctl_setproject() to handle this correctly. Fixes: 9b7365fc1c82 ("ext4: add FS_IOC_FSSETXATTR/FS_IOC_FSGETXATTR interface support") Signed-off-by: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/ioctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index eae5917c534e..0acf8cacb2be 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -365,7 +365,7 @@ static int ext4_ioctl_setproject(struct file *filp, __u32 projid)
struct dquot *transfer_to[MAXQUOTAS] = { };
transfer_to[PRJQUOTA] = dqget(sb, make_kqid_projid(kprojid));
- if (transfer_to[PRJQUOTA]) {
+ if (!IS_ERR(transfer_to[PRJQUOTA])) {
err = __dquot_transfer(inode, transfer_to);
dqput(transfer_to[PRJQUOTA]);
if (err)