~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to debian/patches/bugfix/all/rtl8192su-check-for-skb-NULL.patch

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
2
 
Date: Tue, 4 May 2010 14:23:43 +0200
3
 
Subject: [PATCH] Staging: rtl8192su: check for skb == NULL
4
 
 
5
 
commit 199ef62a287b429a8fa3b7dc5ae6b69f607bf324 upstream.
6
 
 
7
 
added 2 checks for skb == NULL.
8
 
plus cosmetics
9
 
 
10
 
Signed-off-by: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
11
 
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12
 
[bwh: Remove cosmetic changes]
13
 
---
14
 
--- a/drivers/staging/rtl8192su/r8192S_firmware.c
15
 
+++ b/drivers/staging/rtl8192su/r8192S_firmware.c
16
 
@@ -68,6 +68,11 @@
17
 
 
18
 
                /* Allocate skb buffer to contain firmware info and tx descriptor info. */
19
 
                skb  = dev_alloc_skb(frag_length);
20
 
+               if (skb == NULL) {
21
 
+                       RT_TRACE(COMP_ERR, "(%s): unable to alloc skb buffer\n",
22
 
+                                                               __func__);
23
 
+                       goto cmdsend_downloadcode_fail;
24
 
+               }
25
 
                memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev));
26
 
 
27
 
                tcb_desc = (cb_desc*)(skb->cb + MAX_DEV_ADDR_SIZE);
28
 
--- a/drivers/staging/rtl8192su/r819xU_cmdpkt.c
29
 
+++ b/drivers/staging/rtl8192su/r819xU_cmdpkt.c
30
 
@@ -56,6 +56,12 @@ bool SendTxCommandPacket(struct net_device *dev, void *pData, u32 DataLen)
31
 
 
32
 
        //Get TCB and local buffer from common pool. (It is shared by CmdQ, MgntQ, and USB coalesce DataQ)
33
 
        skb  = dev_alloc_skb(USB_HWDESC_HEADER_LEN + DataLen + 4);
34
 
+       if (skb == NULL) {
35
 
+               RT_TRACE(COMP_ERR, "(%s): unable to alloc skb buffer\n",
36
 
+                                                               __func__);
37
 
+               rtStatus = false;
38
 
+               return rtStatus;
39
 
+       }
40
 
        memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev));
41
 
        tcb_desc = (cb_desc*)(skb->cb + MAX_DEV_ADDR_SIZE);
42
 
        tcb_desc->queue_index = TXCMD_QUEUE;