[Intel-wired-lan] [PATCH S44 13/14] ice: fix kernel BUG if register_netdev fails

Bowers, AndrewX andrewx.bowers at intel.com
Tue May 26 20:26:39 UTC 2020


> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf Of
> Tony Nguyen
> Sent: Friday, May 15, 2020 5:42 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH S44 13/14] ice: fix kernel BUG if
> register_netdev fails
> 
> From: Jacob Keller <jacob.e.keller at intel.com>
> 
> If register_netdev() fails, the driver will attempt to cleanup the q_vectors
> and inadvertently trigger a kernel BUG due to a NULL pointer dereference.
> 
> This occurs because cleaning up q_vectors attempts to call netif_napi_del on
> napi_structs which were never initialized.
> 
> Resolve this by releasing the netdev in ice_cfg_netdev and setting
> vsi->netdev to NULL. This ensures that after ice_cfg_netdev fails the
> state is rewound to match as if ice_cfg_netdev was never called.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_main.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers at intel.com>




More information about the Intel-wired-lan mailing list