public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] binderfs: fix error return code in binderfs_fill_super()
@ 2019-01-16  3:01 Wei Yongjun
  2019-01-16  6:25 ` Christian Brauner
  2019-01-16  8:34 ` [PATCH -next v2] " Wei Yongjun
  0 siblings, 2 replies; 11+ messages in thread
From: Wei Yongjun @ 2019-01-16  3:01 UTC (permalink / raw)
  To: gregkh, arve, tkjos, maco, joel, christian
  Cc: Wei Yongjun, devel, linux-kernel, kernel-janitors

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@huawei.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)




^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-01-16 10:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-16  3:01 [PATCH -next] binderfs: fix error return code in binderfs_fill_super() Wei Yongjun
2019-01-16  6:25 ` Christian Brauner
2019-01-16  6:28   ` Christian Brauner
2019-01-16  6:53     ` Greg KH
2019-01-16  8:54   ` Dan Carpenter
2019-01-16  8:34 ` [PATCH -next v2] " Wei Yongjun
2019-01-16  8:41   ` Christian Brauner
2019-01-16  8:45     ` Christian Brauner
2019-01-16 10:39   ` [PATCH v3] " Wei Yongjun
2019-01-16 10:34     ` weiyongjun (A)
2019-01-16 10:42     ` [PATCH v4] " Wei Yongjun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox