* [PATCH] hpfs: kstrdup() memory handling
@ 2015-03-21 16:57 Sanidhya Kashyap
0 siblings, 0 replies; only message in thread
From: Sanidhya Kashyap @ 2015-03-21 16:57 UTC (permalink / raw)
To: mikulas, linux-kernel; +Cc: taesoo, changwoo, sanidhya, blee, Sanidhya Kashyap
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@gmail.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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-03-21 16:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-21 16:57 [PATCH] hpfs: kstrdup() memory handling Sanidhya Kashyap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome