All of lore.kernel.org
 help / color / mirror / Atom feed
From: xerofoify@gmail.com (Nicholas Krause)
To: kernelnewbies@lists.kernelnewbies.org
Subject: [PATCH] staging: Check for Null return of fw_download_code
Date: Wed, 13 Aug 2014 15:59:18 -0400	[thread overview]
Message-ID: <1407959958-22471-1-git-send-email-xerofoify@gmail.com> (raw)

This patch fixes the bug , https://bugzilla.kernel.org/show_bug.cgi?id=60461
on the kernel bugzilla. Further more I am checking if we are allocating a
NULL skb and if so make rt_status to false and free the quene we are using
for allocated skbs in the while/do loop with skb_quene_purge.

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
index 1a95d1f..0f18c6d 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
@@ -61,6 +61,11 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
 		}
 
 		skb  = dev_alloc_skb(frag_length + 4);
+		if (skb == NULL) {
+			rt_status = false;
+			skb_queue_purge(&priv->rtllib->skb_waitQ[TXCMD_QUEUE]);
+			break;
+		}
 		memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev));
 		tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
 		tcb_desc->queue_index = TXCMD_QUEUE;
-- 
1.9.1

             reply	other threads:[~2014-08-13 19:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-13 19:59 Nicholas Krause [this message]
2014-08-13 20:01 ` [PATCH] staging: Check for Null return of fw_download_code Nick Krause
  -- strict thread matches above, loose matches on Subject: below --
2014-08-13 19:54 Nicholas Krause
2014-08-13 19:55 ` Nick Krause
2014-08-13 19:00 Nicholas Krause
2014-08-13 19:01 ` Nick Krause

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1407959958-22471-1-git-send-email-xerofoify@gmail.com \
    --to=xerofoify@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.