Re: [PATCH] net: sh_eth: avoid NULL pointer dereference in ring setup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

On 03/02/2016 06:26 PM, Wolfram Sang wrote:

From: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>

When allocating an skb fails, rxdesc is still NULL (or the previous ring
index on further iterations of the loop). However, this pointer is
dereferenced after the loop.

This is intended. What we seem to actually need is a NULL check before that dereference.

So, make sure rxdesc is updated immediately
at the beginning of the loop.

No, this seems wrong. We don't want an unfilled descriptor to be marked as last, we still need the previous one marked as last. Actually, 'rxdesc' shouldn't be "advanced" even before the second *break* as it is now.

Reported-by: coverity (CID 1056464)
Signed-off-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>

   Will you respin or should I?

MBR, Sergei




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux