hpfs: kstrdup() memory handling
PATCH 1/1 hpfs: kstrdup() memory handling
There is a possibility of nothing being allocated to the new_opts in case of memory pressure, therefore return ENOMEM for such case.
Signed-off-by Sanidhya Kashyap <[email protected]>
--- fs/hpfs/super.c | 3 +++ 1 file changed, 3 insertions(+)
fs/hpfs/super.c +3 -0
@@ -424,6 +424,9 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data)int o;struct hpfs_sb_info *sbi =hpfs_sb (s);char *new_opts =kstrdup (data,GFP_KERNEL ); + +if (!new_opts) +return -ENOMEM ;sync_filesystem (s);
Signature · 1 line
2.1.0