From mboxrd@z Thu Jan 1 00:00:00 1970 From: doug.lkml@gmail.com (Doug Wilson) Date: Mon, 8 Sep 2014 18:15:28 +0530 Subject: Bug Patch In-Reply-To: References: <540D86B2.6080505@gmail.com> Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Tobi, Nick, > I think Nick's patch is regarding dev_alloc_skb(nSubframe_Length + 12) ; > There is no error check for the return value of dev_alloc_skb , and > it can return NULL if it fails and the memory is not allocated. > I admit return -ENOMEM is wrong , but still I think Nick has found > something this time. > Nick, the patch you sent is doing the right thing, but like Tobi mentioned -ENOMEM is wrong. dev_alloc_skb internally calls __netdev_alloc_skb and the comment on top of the function says *%NULL is returned if there is no free memory*. So could you change the patch accordingly. for eg: if (sub_skb == NULL) return NULL; - Doug