Skip to content

Commit

Permalink
drivers/misc/lkdtm.c: fix missing allocation failure check
Browse files Browse the repository at this point in the history
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=44691

Reported-by: <rucsoftsec@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Alan Cox authored and Linus Torvalds committed Jul 31, 2012
1 parent e04f228 commit 086ff4b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/misc/lkdtm.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,8 @@ static ssize_t lkdtm_debugfs_read(struct file *f, char __user *user_buf,
int i, n, out;

buf = (char *)__get_free_page(GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;

n = snprintf(buf, PAGE_SIZE, "Available crash types:\n");
for (i = 0; i < ARRAY_SIZE(cp_type); i++)
Expand Down

0 comments on commit 086ff4b

Please sign in to comment.