[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1547607664-5612-1-git-send-email-weiyongjun1@huawei.com>
Date: Wed, 16 Jan 2019 03:01:04 +0000
From: Wei Yongjun <weiyongjun1@...wei.com>
To: <gregkh@...uxfoundation.org>, <arve@...roid.com>,
<tkjos@...roid.com>, <maco@...roid.com>, <joel@...lfernandes.org>,
<christian@...uner.io>
CC: Wei Yongjun <weiyongjun1@...wei.com>, <devel@...verdev.osuosl.org>,
<linux-kernel@...r.kernel.org>, <kernel-janitors@...r.kernel.org>
Subject: [PATCH -next] binderfs: fix error return code in binderfs_fill_super()
Fix to return a negative error code -ENOMEM from the new_inode() and
d_make_root() error handling cases instead of 0, as done elsewhere in
this function.
Fixes: 3ad20fe393b3 ("binder: implement binderfs")
Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>
---
drivers/android/binderfs.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/android/binderfs.c b/drivers/android/binderfs.c
index 9518e2e..2bf4b2b 100644
--- a/drivers/android/binderfs.c
+++ b/drivers/android/binderfs.c
@@ -519,8 +519,10 @@ static int binderfs_fill_super(struct super_block *sb, void *data, int silent)
sb->s_fs_info = info;
inode = new_inode(sb);
- if (!inode)
+ if (!inode) {
+ ret = -ENOMEM;
goto err_without_dentry;
+ }
inode->i_ino = FIRST_INODE;
inode->i_fop = &simple_dir_operations;
@@ -530,8 +532,10 @@ static int binderfs_fill_super(struct super_block *sb, void *data, int silent)
set_nlink(inode, 2);
sb->s_root = d_make_root(inode);
- if (!sb->s_root)
+ if (!sb->s_root) {
+ ret = -ENOMEM;
goto err_without_dentry;
+ }
ret = binderfs_binder_ctl_create(sb);
if (ret)
Powered by blists - more mailing lists