]> git.baikalelectronics.ru Git - kernel.git/commit
net: ethernet: ezchip: fix error handling
authorPavel Skripkin <paskripkin@gmail.com>
Fri, 18 Jun 2021 16:14:47 +0000 (19:14 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 19 Jun 2021 18:46:00 +0000 (11:46 -0700)
commit2bdac0d3b20969f64164a54ba489eb5e0efeba34
treee2d92a2b12829bc7c4967e06f7b50d96e91e6654
parent3cc061565b88b5da52bd9d447461d5b343f96e03
net: ethernet: ezchip: fix error handling

As documented at drivers/base/platform.c for platform_get_irq:

 * Gets an IRQ for a platform device and prints an error message if finding the
 * IRQ fails. Device drivers should check the return value for errors so as to
 * not pass a negative integer value to the request_irq() APIs.

So, the driver should check that platform_get_irq() return value
is _negative_, not that it's equal to zero, because -ENXIO (return
value from request_irq() if irq was not found) will
pass this check and it leads to passing negative irq to request_irq()

Fixes: 95c56cc33779 ("NET: Add ezchip ethernet driver")
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ezchip/nps_enet.c