net: ena: fix NULL dereference due to untimely napi initialization
authorArthur Kiyanovski <akiyano@amazon.com>
Tue, 9 Oct 2018 08:21:29 +0000 (11:21 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Nov 2018 13:52:47 +0000 (14:52 +0100)
commit1e4f8315a5c8e914fb6365c930b45fffd73b02cd
tree05c8910b5c6a998bfdff8cea431c2647b2af0272
parentba4cf1eefd54fbeadf90cfe8236643bed5681548
net: ena: fix NULL dereference due to untimely napi initialization

[ Upstream commit 78a55d05def95144ca5fa9a64c49b2a0636a9866 ]

napi poll functions should be initialized before running request_irq(),
to handle a rare condition where there is a pending interrupt, causing
the ISR to fire immediately while the poll function wasn't set yet,
causing a NULL dereference.

Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/amazon/ena/ena_netdev.c