diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-06-06 06:57:46 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-06-10 14:41:26 -0400 |
commit | f7a01cac7305391433d609bd23241e4138e2fb84 (patch) | |
tree | e76625abe3edceb21c8666d80674b9a9d17afd04 /drivers/net/wireless/cw1200/wsm.c | |
parent | f28bc92c9530fe39eccfcff392879f19bd234578 (diff) |
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>
Diffstat (limited to 'drivers/net/wireless/cw1200/wsm.c')
-rw-r--r-- | drivers/net/wireless/cw1200/wsm.c | 2 |
1 files changed, 2 insertions, 0 deletions
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) | |||
929 | } | 929 | } |
930 | 930 | ||
931 | event = kzalloc(sizeof(struct cw1200_wsm_event), GFP_KERNEL); | 931 | event = kzalloc(sizeof(struct cw1200_wsm_event), GFP_KERNEL); |
932 | if (!event) | ||
933 | return -ENOMEM; | ||
932 | 934 | ||
933 | event->evt.id = __le32_to_cpu(WSM_GET32(buf)); | 935 | event->evt.id = __le32_to_cpu(WSM_GET32(buf)); |
934 | event->evt.data = __le32_to_cpu(WSM_GET32(buf)); | 936 | event->evt.data = __le32_to_cpu(WSM_GET32(buf)); |