From: Alan Cox Date: Mon, 30 Jul 2012 21:43:24 +0000 (-0700) Subject: drivers/misc/lkdtm.c: fix missing allocation failure check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=086ff4b3a7fb9cdf41e6a5d0ccd99b86d84633a1;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git drivers/misc/lkdtm.c: fix missing allocation failure check Addresses https://bugzilla.kernel.org/show_bug.cgi?id=44691 Reported-by: Signed-off-by: Alan Cox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/misc/lkdtm.c b/drivers/misc/lkdtm.c index 28adefe70f96..08aad69c8da4 100644 --- a/drivers/misc/lkdtm.c +++ b/drivers/misc/lkdtm.c @@ -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++)