stmmac: fix pointer check after utilization in stmmac_interrupt
authorMaxim Petrov <mmrmaximuzz@gmail.com>
Mon, 4 May 2020 06:26:43 +0000 (09:26 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 May 2020 15:46:34 +0000 (17:46 +0200)
commit42b32a43529eb07f1e53ac987a027c3dbb6adb45
tree2786eeaa041466bda86e13bf638d389754fa3091
parentb68d27c5fffd287d64ecbdc570312d668373f1e7
stmmac: fix pointer check after utilization in stmmac_interrupt

[ Upstream commit f42234ffd531ca6b13d9da02faa60b72eccf8334 ]

The paranoidal pointer check in IRQ handler looks very strange - it
really protects us only against bogus drivers which request IRQ line
with null pointer dev_id. However, the code fragment is incorrect
because the dev pointer is used before the actual check which leads
to undefined behavior. Remove the check to avoid confusing people
with incorrect code.

Signed-off-by: Maxim Petrov <mmrmaximuzz@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c