lkml.org 
[lkml]   [2014]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] staging: rtl8192e: check return value of dev_skb_alloc
From
Date
On Thu, 2014-06-19 at 15:29 -0400, Nicholas Krause wrote:

> diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
[]
> @@ -59,7 +58,8 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
> bLastIniPkt = 1;
>
> }
> -
> + if (!skb)
> + return false;
> skb = dev_alloc_skb(frag_length + 4);

Nick.

You may have compiled this, but it's obvious you
haven't tested it.

Please stop sending patches until you can verify what
you're doing with the code.

Please train a few more of your neurons for coding.

It takes some time and some practice but please don't
practice on linux-kernel.

Use google to find some other suitable forums like
http://cboard.cprogramming.com/c-programming/

Back to your patch:

if (!skb)
return false;

must go _after_

skb = dev_alloc_skb(frag_length + 4);





\
 
 \ /
  Last update: 2014-06-19 23:41    [W:0.049 / U:0.664 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site