reiserfs-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] reiserfs: kstrdup() memory handling
@ 2015-03-21 17:00 Sanidhya Kashyap
  2015-03-21 17:15 ` Josh Triplett
  0 siblings, 1 reply; 4+ messages in thread
From: Sanidhya Kashyap @ 2015-03-21 17:00 UTC (permalink / raw)
  To: jack, jeffm, akpm, fabf, josh, rashika.kheria, reiserfs-devel,
	linux-kernel
  Cc: taesoo, changwoo, sanidhya, blee, Sanidhya Kashyap

Checking for ENOMEM even for new_opts in reiserfs_remount function as
there is a possibility of nothing being allocated.

Signed-off-by: Sanidhya Kashyap <sanidhya.gatech@gmail.com>
---
 fs/reiserfs/super.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 71fbbe3..bf9bc66 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -1397,6 +1397,11 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
 	int i;
 #endif
 
+	if (!new_opts) {
+		err = -ENOMEM;
+		goto out_err_no_kfree;
+	}
+
 	sync_filesystem(s);
 	reiserfs_write_lock(s);
 
@@ -1549,6 +1554,7 @@ out_err_unlock:
 	reiserfs_write_unlock(s);
 out_err:
 	kfree(new_opts);
+out_err_no_kfree:
 	return err;
 }
 
-- 
2.1.0

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

end of thread, other threads:[~2015-03-23  2:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-21 17:00 [PATCH] reiserfs: kstrdup() memory handling Sanidhya Kashyap
2015-03-21 17:15 ` Josh Triplett
2015-03-23  0:12   ` Sanidhya Kashyap
2015-03-23  2:55     ` Josh Triplett

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