From 5353cf089bb32b69a7515be909c14bf05fe2e81e Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 30 Jul 2012 14:40:06 -0700 Subject: drivers/misc/ti-st/st_core.c: missing NULL check Addresses https://bugzilla.kernel.org/show_bug.cgi?44431 Reported-by: Signed-off-by: Alan Cox Cc: Pavan Savoy Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/misc/ti-st/st_core.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/misc') diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c index 2b62232c2c6a..acfaeeb9e01a 100644 --- a/drivers/misc/ti-st/st_core.c +++ b/drivers/misc/ti-st/st_core.c @@ -349,6 +349,11 @@ void st_int_recv(void *disc_data, st_gdata->rx_skb = alloc_skb( st_gdata->list[type]->max_frame_size, GFP_ATOMIC); + if (st_gdata->rx_skb == NULL) { + pr_err("out of memory: dropping\n"); + goto done; + } + skb_reserve(st_gdata->rx_skb, st_gdata->list[type]->reserve); /* next 2 required for BT only */ -- cgit v1.2.3 From 086ff4b3a7fb9cdf41e6a5d0ccd99b86d84633a1 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 30 Jul 2012 14:43:24 -0700 Subject: 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 --- drivers/misc/lkdtm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/misc') 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++) -- cgit v1.2.3