mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
affs: kstrdup() memory handling
There is a possibility of kstrdup() failure upon memory pressure. Therefore, returning ENOMEM even for new_opts. [[email protected]: cleanup] Signed-off-by: Sanidhya Kashyap <[email protected]> Cc: Taesoo kim <[email protected]> Cc: Fabian Frederick <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
79bda4d510
commit
c8f33d0bec
1 changed files with 5 additions and 1 deletions
|
|
@ -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);
|
||||
|
||||
sync_filesystem(sb);
|
||||
|
|
|
|||
Loading…
Reference in a new issue