From f7a01cac7305391433d609bd23241e4138e2fb84 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 6 Jun 2013 03:57:46 -0700 Subject: [PATCH] cw1200: handle allocation failure in wsm_event_indication() Check for allocation failures and return -ENOMEM. The caller already expects it. Signed-off-by: Dan Carpenter Signed-off-by: John W. Linville --- drivers/net/wireless/cw1200/wsm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/cw1200/wsm.c b/drivers/net/wireless/cw1200/wsm.c index f3fd9b218724..3ab25f661793 100644 --- a/drivers/net/wireless/cw1200/wsm.c +++ b/drivers/net/wireless/cw1200/wsm.c @@ -929,6 +929,8 @@ static int wsm_event_indication(struct cw1200_common *priv, struct wsm_buf *buf) } event = kzalloc(sizeof(struct cw1200_wsm_event), GFP_KERNEL); + if (!event) + return -ENOMEM; event->evt.id = __le32_to_cpu(WSM_GET32(buf)); event->evt.data = __le32_to_cpu(WSM_GET32(buf)); -- 2.39.5