* [PATCH] UBIFS: fix error return code in ubifs_remount_rw() and ubifs_fill_super()
@ 2013-06-07 2:17 Wei Yongjun
2013-10-02 19:59 ` Brian Norris
0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2013-06-07 2:17 UTC (permalink / raw)
To: dedekind1, adrian.hunter; +Cc: yongjun_wei, linux-mtd, linux-kernel
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Fix to return -ENOMEM in the kmalloc() and d_make_root() error handling
case instead of 0, as done elsewhere in those functions.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
fs/ubifs/super.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index f21acf0..673b4bc 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1629,8 +1629,10 @@ static int ubifs_remount_rw(struct ubifs_info *c)
}
c->write_reserve_buf = kmalloc(COMPRESSED_DATA_NODE_BUF_SZ, GFP_KERNEL);
- if (!c->write_reserve_buf)
+ if (!c->write_reserve_buf) {
+ err = -ENOMEM;
goto out;
+ }
err = ubifs_lpt_init(c, 0, 1);
if (err)
@@ -2063,8 +2065,10 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent)
}
sb->s_root = d_make_root(root);
- if (!sb->s_root)
+ if (!sb->s_root) {
+ err = -ENOMEM;
goto out_umount;
+ }
mutex_unlock(&c->umount_mutex);
return 0;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] UBIFS: fix error return code in ubifs_remount_rw() and ubifs_fill_super()
2013-06-07 2:17 [PATCH] UBIFS: fix error return code in ubifs_remount_rw() and ubifs_fill_super() Wei Yongjun
@ 2013-10-02 19:59 ` Brian Norris
2013-10-26 10:14 ` Artem Bityutskiy
0 siblings, 1 reply; 3+ messages in thread
From: Brian Norris @ 2013-10-02 19:59 UTC (permalink / raw)
To: Artem Bityutskiy
Cc: Adrian Hunter, yongjun_wei, linux-mtd, Linux Kernel, Wei Yongjun
Bump, Artem? I'm cleaning out my old email, and this patch looks
obviously correct.
On Thu, Jun 6, 2013 at 7:17 PM, Wei Yongjun <weiyj.lk@gmail.com> wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Fix to return -ENOMEM in the kmalloc() and d_make_root() error handling
> case instead of 0, as done elsewhere in those functions.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
> fs/ubifs/super.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
> index f21acf0..673b4bc 100644
> --- a/fs/ubifs/super.c
> +++ b/fs/ubifs/super.c
> @@ -1629,8 +1629,10 @@ static int ubifs_remount_rw(struct ubifs_info *c)
> }
>
> c->write_reserve_buf = kmalloc(COMPRESSED_DATA_NODE_BUF_SZ, GFP_KERNEL);
> - if (!c->write_reserve_buf)
> + if (!c->write_reserve_buf) {
> + err = -ENOMEM;
> goto out;
> + }
>
> err = ubifs_lpt_init(c, 0, 1);
> if (err)
> @@ -2063,8 +2065,10 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent)
> }
>
> sb->s_root = d_make_root(root);
> - if (!sb->s_root)
> + if (!sb->s_root) {
> + err = -ENOMEM;
> goto out_umount;
> + }
>
> mutex_unlock(&c->umount_mutex);
> return 0;
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] UBIFS: fix error return code in ubifs_remount_rw() and ubifs_fill_super()
2013-10-02 19:59 ` Brian Norris
@ 2013-10-26 10:14 ` Artem Bityutskiy
0 siblings, 0 replies; 3+ messages in thread
From: Artem Bityutskiy @ 2013-10-26 10:14 UTC (permalink / raw)
To: Brian Norris
Cc: Adrian Hunter, yongjun_wei, linux-mtd, Linux Kernel, Wei Yongjun
On Wed, 2013-10-02 at 12:59 -0700, Brian Norris wrote:
> Bump, Artem? I'm cleaning out my old email, and this patch looks
> obviously correct.
Picked to linux-ubifs.git, thanks!
--
Best Regards,
Artem Bityutskiy
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-10-26 10:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-07 2:17 [PATCH] UBIFS: fix error return code in ubifs_remount_rw() and ubifs_fill_super() Wei Yongjun
2013-10-02 19:59 ` Brian Norris
2013-10-26 10:14 ` Artem Bityutskiy
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).