[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1426957070-2914-1-git-send-email-sanidhya.gatech@gmail.com>
Date: Sat, 21 Mar 2015 12:57:50 -0400
From: Sanidhya Kashyap <sanidhya.gatech@...il.com>
To: mikulas@...ax.karlin.mff.cuni.cz, linux-kernel@...r.kernel.org
Cc: taesoo@...ech.edu, changwoo@...ech.edu, sanidhya@...ech.edu,
blee@...ech.edu, Sanidhya Kashyap <sanidhya.gatech@...il.com>
Subject: [PATCH] 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 <sanidhya.gatech@...il.com>
---
fs/hpfs/super.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c
index 7cd00d3..885eadb 100644
--- a/fs/hpfs/super.c
+++ b/fs/hpfs/super.c
@@ -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);
--
2.1.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists