mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] affs: kstrdup() memory handling
@ 2015-03-21 16:46 Sanidhya Kashyap
  0 siblings, 0 replies; only message in thread
From: Sanidhya Kashyap @ 2015-03-21 16:46 UTC (permalink / raw)
  To: akpm, fabf, linux-fsdevel, linux-kernel
  Cc: taesoo, changwoo, sanidhya, blee, csong84, Sanidhya Kashyap

There is a possibility of kstrdup() failure upon memory pressure.
Therefore, returning ENOMEM even for new_opts.

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

diff --git a/fs/affs/super.c b/fs/affs/super.c
index 4cf0e91..f4d0d36 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -524,6 +524,10 @@ affs_remount(struct super_block *sb, int *flags, char *data)
 	char			 volume[32];
 	char			*prefix = NULL;
 
+
+	if (!new_opts)
+		return -ENOMEM;
+
 	pr_debug("%s(flags=0x%x,opts=\"%s\")\n", __func__, *flags, data);
 
 	sync_filesystem(sb);
-- 
2.1.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-03-21 16:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-21 16:46 [PATCH] affs: kstrdup() memory handling Sanidhya Kashyap

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

Powered by JetHome