Skip to contentSkip to conversation

cw1200: handle allocation failure in wsm_event_indication()

PATCH New Dan Carpenter 1 participant 1 message Jun 6, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cw1200: handle allocation failure in wsm_event_indication()

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

drivers/net/wireless/cw1200/wsm.c +2 -0
index f3fd9b2..3ab25f6 100644
@@ -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));