diff mbox

affs: kstrdup() memory handling

Message ID 1426956384-22742-1-git-send-email-sanidhya.gatech@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sanidhya Kashyap March 21, 2015, 4:46 p.m. UTC
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 mbox

Patch

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