Browse Source

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 <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Dan Carpenter 12 years ago
parent
commit
f7a01cac73
1 changed files with 2 additions and 0 deletions
  1. 2 0
      drivers/net/wireless/cw1200/wsm.c

+ 2 - 0
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));