mirror of
https://github.com/torvalds/linux.git
synced 2024-12-16 08:02:17 +00:00
staging: rtl8192u: check dev_alloc_skb() return value in fw_download_code()
This patch adds a check whether skb allocation, in fw_download_code(), was successful. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ccb0ec8338
commit
f8518efa4e
@ -62,6 +62,8 @@ bool fw_download_code(struct net_device *dev, u8 *code_virtual_address, u32 buff
|
|||||||
* add 4 to avoid packet appending overflow.
|
* add 4 to avoid packet appending overflow.
|
||||||
* */
|
* */
|
||||||
skb = dev_alloc_skb(USB_HWDESC_HEADER_LEN + frag_length + 4);
|
skb = dev_alloc_skb(USB_HWDESC_HEADER_LEN + frag_length + 4);
|
||||||
|
if (!skb)
|
||||||
|
return false;
|
||||||
memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev));
|
memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev));
|
||||||
tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
|
tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
|
||||||
tcb_desc->queue_index = TXCMD_QUEUE;
|
tcb_desc->queue_index = TXCMD_QUEUE;
|
||||||
|
Loading…
Reference in New Issue
Block a user