diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2012-01-04 21:50:47 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-01-10 15:46:39 -0500 |
commit | d90db4b12bc1b9b8a787ef28550fdb767ee25a49 (patch) | |
tree | cf0aa627c4acd887de9555202feccb983868eddc /drivers/net/wireless | |
parent | 874c60bad92564358e87d58f505fceb0b09ec1aa (diff) |
rtl8192se: Fix BUG caused by failure to check skb allocation
When downloading firmware into the device, the driver fails to check the
return when allocating an skb. When the allocation fails, a BUG can be
generated, as seen in https://bugzilla.redhat.com/show_bug.cgi?id=771656.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192se/fw.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/fw.c b/drivers/net/wireless/rtlwifi/rtl8192se/fw.c index 6f91a148c222..3fda6b1dcf46 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192se/fw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192se/fw.c | |||
@@ -196,6 +196,8 @@ static bool _rtl92s_firmware_downloadcode(struct ieee80211_hw *hw, | |||
196 | /* Allocate skb buffer to contain firmware */ | 196 | /* Allocate skb buffer to contain firmware */ |
197 | /* info and tx descriptor info. */ | 197 | /* info and tx descriptor info. */ |
198 | skb = dev_alloc_skb(frag_length); | 198 | skb = dev_alloc_skb(frag_length); |
199 | if (!skb) | ||
200 | return false; | ||
199 | skb_reserve(skb, extra_descoffset); | 201 | skb_reserve(skb, extra_descoffset); |
200 | seg_ptr = (u8 *)skb_put(skb, (u32)(frag_length - | 202 | seg_ptr = (u8 *)skb_put(skb, (u32)(frag_length - |
201 | extra_descoffset)); | 203 | extra_descoffset)); |
@@ -573,6 +575,8 @@ static bool _rtl92s_firmware_set_h2c_cmd(struct ieee80211_hw *hw, u8 h2c_cmd, | |||
573 | 575 | ||
574 | len = _rtl92s_get_h2c_cmdlen(MAX_TRANSMIT_BUFFER_SIZE, 1, &cmd_len); | 576 | len = _rtl92s_get_h2c_cmdlen(MAX_TRANSMIT_BUFFER_SIZE, 1, &cmd_len); |
575 | skb = dev_alloc_skb(len); | 577 | skb = dev_alloc_skb(len); |
578 | if (!skb) | ||
579 | return false; | ||
576 | cb_desc = (struct rtl_tcb_desc *)(skb->cb); | 580 | cb_desc = (struct rtl_tcb_desc *)(skb->cb); |
577 | cb_desc->queue_index = TXCMD_QUEUE; | 581 | cb_desc->queue_index = TXCMD_QUEUE; |
578 | cb_desc->cmd_or_init = DESC_PACKET_TYPE_NORMAL; | 582 | cb_desc->cmd_or_init = DESC_PACKET_TYPE_NORMAL; |