Commit c8f33d0b authored by Sanidhya Kashyap's avatar Sanidhya Kashyap Committed by Linus Torvalds
Browse files

affs: kstrdup() memory handling

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

[ cleanup]
Signed-off-by: default avatarSanidhya Kashyap <>
Cc: Taesoo kim <>
Cc: Fabian Frederick <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 79bda4d5
......@@ -521,10 +521,14 @@ affs_remount(struct super_block *sb, int *flags, char *data)
int root_block;
unsigned long mount_flags;
int res = 0;
char *new_opts = kstrdup(data, GFP_KERNEL);
char *new_opts;
char volume[32];
char *prefix = NULL;
new_opts = kstrdup(data, GFP_KERNEL);
if (!new_opts)
return -ENOMEM;
pr_debug("%s(flags=0x%x,opts=\"%s\")\n", __func__, *flags, data);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment