linux/drivers/net/ethernet/amazon
Arthur Kiyanovski c207979f5a net: ena: ena-com.c: prevent NULL pointer dereference
comp_ctx can be NULL in a very rare case when an admin command is executed
during the execution of ena_remove().

The bug scenario is as follows:

* ena_destroy_device() sets the comp_ctx to be NULL
* An admin command is executed before executing unregister_netdev(),
  this can still happen because our device can still receive callbacks
  from the netdev infrastructure such as ethtool commands.
* When attempting to access the comp_ctx, the bug occurs since it's set
  to NULL

Fix:
Added a check that comp_ctx is not NULL

Fixes: 1738cd3ed3 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Sameeh Jubran <sameehj@amazon.com>
Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-11 17:08:31 -08:00
..
ena net: ena: ena-com.c: prevent NULL pointer dereference 2020-02-11 17:08:31 -08:00
Kconfig net: ena: Select DIMLIB for ENA_ETHERNET 2019-09-22 14:05:18 -07:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00