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>
Sat, 10 Nov 2018 15:42:56 +0000 (07:42 -0800)
commit7bdb3af6a9538de3bc04939adc952347062c6a0e
treeecf255b71c0c3709882a01f493caa6ed4554939a
parent2daa0b5ec29630377c6d14b3d943e1c5c2a65577
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