All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch -next] cw1200: handle allocation failure in wsm_event_indication()
@ 2013-06-06 10:57 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2013-06-06 10:57 UTC (permalink / raw)
  To: Solomon Peachy; +Cc: John W. Linville, linux-wireless, kernel-janitors

Check for allocation failures and return -ENOMEM.  The caller
already expects it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/net/wireless/cw1200/wsm.c b/drivers/net/wireless/cw1200/wsm.c
index f3fd9b2..3ab25f6 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));

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

end of thread, other threads:[~2013-06-06 10:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-06 10:57 [patch -next] cw1200: handle allocation failure in wsm_event_indication() Dan Carpenter
2013-06-06 10:57 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.