This patch adds a check whether skb allocation, in fw_download_code(), was successful. Signed-off-by: Xenia Ragiadakou <burzalodowa@xxxxxxxxx> --- drivers/staging/rtl8192u/r819xU_firmware.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/rtl8192u/r819xU_firmware.c b/drivers/staging/rtl8192u/r819xU_firmware.c index cde4365..106740e 100644 --- a/drivers/staging/rtl8192u/r819xU_firmware.c +++ b/drivers/staging/rtl8192u/r819xU_firmware.c @@ -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; -- 1.8.3.4 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel