From mboxrd@z Thu Jan 1 00:00:00 1970 From: Valdis.Kletnieks@vt.edu (Valdis.Kletnieks at vt.edu) Date: Wed, 13 Aug 2014 12:02:36 -0400 Subject: [PATCH] staging: Check for Null return of allocated skb in fw_download_code In-Reply-To: Your message of "Wed, 13 Aug 2014 18:50:43 +0400." References: <1407900272-29402-1-git-send-email-xerofoify@gmail.com> <14218.1407908124@turing-police.cc.vt.edu> <39663.1407938186@turing-police.cc.vt.edu> Message-ID: <6253.1407945756@turing-police.cc.vt.edu> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Wed, 13 Aug 2014 18:50:43 +0400, Max Filippov said: > No need to trigger it, faking it would be enough, e.g.: > + if (++i < 3) > + skb = dev_alloc_skb(frag_length + 4); > + else > + skb = NULL; Don't bet on this triggering on a real system without some additional scaffolding - take a look at what the function is doing, and ask yourself how many times it will be called on the average system :) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 848 bytes Desc: not available Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140813/645e13da/attachment.bin