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>
This commit is contained in:
Dan Carpenter 2013-06-06 03:57:46 -07:00 committed by John W. Linville
parent f28bc92c95
commit f7a01cac73

View File

@ -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));