]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
staging: rtl8192u: check dev_alloc_skb() return value in fw_download_code()
authorXenia Ragiadakou <burzalodowa@gmail.com>
Sat, 21 Sep 2013 20:42:26 +0000 (23:42 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Sep 2013 23:51:23 +0000 (16:51 -0700)
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>
drivers/staging/rtl8192u/r819xU_firmware.c

index cde4365b6f7ade8a19331b65dd291866d4aede70..106740eef3351e523ff2553ad5ced80a60780072 100644 (file)
@@ -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.
                 * */
                skb  = dev_alloc_skb(USB_HWDESC_HEADER_LEN + frag_length + 4);
+               if (!skb)
+                       return false;
                memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev));
                tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
                tcb_desc->queue_index = TXCMD_QUEUE;