<div dir="ltr"><div class="gmail_extra"><div>On Tue, Aug 12, 2014 at 10:35 PM, <span dir="ltr"><<a href="mailto:Valdis.Kletnieks@vt.edu" target="_blank">Valdis.Kletnieks@vt.edu</a>></span> wrote:<br></div><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Tue, 12 Aug 2014 23:24:32 -0400, Nicholas Krause said:<br>
> This patch checks if we are getting a Null allocated skb in the while/do<br>
> loop of this function.<br>
</div><div class="">> skb = dev_alloc_skb(frag_length + 4);<br>
> + if (skb == NULL) {<br>
> + rt_status = false;<br>
> + break;<br>
> + }<br>
<br>
</div>Nick, it's *STILL* wrong. And although I admit I blew it on the refcount<br>
issue, that doesn't change the fact that you're still leaking memory here.<br>
<br>
Work this through. Hand simulate it. Pretend that 3 fragments are<br>
needed, and that the first two succeed but the third one fails.<br>
<br>
Who frees the first two fragments before you return?<br>
<br>
For bonus points - explain under what conditions this bug can *possibly*<br>
be triggered on an actual system. Consider in your reply both (a) when this<br>
code is called and (b) what the system state *should* be at that point, and<br>
what it has to be for this bug to trigger. Given your answer to (a) and (b),<br>
extrapolate to what the next few hundredths of a second likely hold for<br>
this system even after we've fixed the bug you're mis-fixing here.<br>
<br>
Once you've done that, you'll hopefully understand why you're trying to fix<br>
a bug from 2009.<br>
<br></blockquote><div><br></div><div>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 someone else to send the patch on behalf of you, anyone who volunteers would like to verify that the patch is indeed tested properly before forwarding.</div>
<div><br></div><div>Thanks -</div><div>Manish</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div><br></div></div>