]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: felix: initialize "err" to 0 in felix_check_xtr_pkt()
authorVladimir Oltean <vladimir.oltean@nxp.com>
Thu, 3 Mar 2022 14:01:24 +0000 (16:01 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Mar 2022 09:21:23 +0000 (09:21 +0000)
commit4dbc7c9919148e20e251b19bc6845a1dc3119e85
tree0faf7a71e685475c839bc188570372b63269f375
parent4546022c282b4c2c14ce9641eaf9fce7aa8b5954
net: dsa: felix: initialize "err" to 0 in felix_check_xtr_pkt()

Automated tools complain that felix_check_xtr_pkt() has logic to drain
the CPU queue on the reception of a PTP packet over Ethernet, yet it
returns an uninitialized error code in the case where the CPU queue was
empty.

This is not likely to happen (/possible if hardware works correctly),
but it isn't a fatal condition either. The PTP packet will be dequeued
from the CPU queue when the next PTP packet arrives. So initialize "err"
to 0 for the case where nothing was dequeued during this iteration.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/ocelot/felix.c