mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* pstore: pmsg: return -ENOMEM on vmalloc failure
@ 2015-08-20 21:21 Mark Salyzyn
  2015-08-20 21:39 ` Kees Cook
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Salyzyn @ 2015-08-20 21:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Mark Salyzyn, Anton Vorontsov, Colin Cross, Kees Cook, Tony Luck

Signed-off-by: Mark Salyzyn <salyzyn@android.com>
---
 fs/pstore/pmsg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/pstore/pmsg.c b/fs/pstore/pmsg.c
index feb5dd2..5a2f05a 100644
--- a/fs/pstore/pmsg.c
+++ b/fs/pstore/pmsg.c
@@ -37,6 +37,8 @@ static ssize_t write_pmsg(struct file *file, const char __user *buf,
 	if (buffer_size > PMSG_MAX_BOUNCE_BUFFER_SIZE)
 		buffer_size = PMSG_MAX_BOUNCE_BUFFER_SIZE;
 	buffer = vmalloc(buffer_size);
+	if (!buffer)
+		return -ENOMEM;
 
 	mutex_lock(&pmsg_lock);
 	for (i = 0; i < count; ) {
-- 
2.5.0.276.gf5e568e


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-08-20 21:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-20 21:21 pstore: pmsg: return -ENOMEM on vmalloc failure Mark Salyzyn
2015-08-20 21:39 ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®