[PATCH] staging: Check for Null return of allocated skb in fw_download_code

Max Filippov jcmvbkbc at gmail.com
Wed Aug 13 10:50:43 EDT 2014


On Wed, Aug 13, 2014 at 5:56 PM,  <Valdis.Kletnieks at vt.edu> wrote:
> On Tue, 12 Aug 2014 22:53:37 -0700, Manish Katiyar said:
>
>> And it may also be a good idea to post the logs regarding how you tested
>> your patch and verified that the fix works as expected. As you are asking
>
> I want to see how he sets up an environment where he can *trigger* the issue
> reliably. :)

No need to trigger it, faking it would be enough, e.g.:

-               skb  = dev_alloc_skb(frag_length + 4);
+        {
+                static int i;
+                if (++i < 3)
+                        skb  = dev_alloc_skb(frag_length + 4);
+                else
+                        skb = NULL;
+        }
+        if (skb == NULL) {
+                rt_status =  false;
+                break;
+        }

-- 
Thanks.
-- Max



More information about the Kernelnewbies mailing list