Commit c38d7e0d authored by Henry Orosco's avatar Henry Orosco Committed by Doug Ledford

i40iw: Fix for LAN handler removal

If i40iw_open() fails for any reason, the LAN handler
is not being removed. Modify i40iw_deinit_device()
to always remove the handler.
Signed-off-by: default avatarMustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: default avatarHenry Orosco <henry.orosco@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 01d0b367
...@@ -1422,12 +1422,11 @@ static enum i40iw_status_code i40iw_save_msix_info(struct i40iw_device *iwdev, ...@@ -1422,12 +1422,11 @@ static enum i40iw_status_code i40iw_save_msix_info(struct i40iw_device *iwdev,
* i40iw_deinit_device - clean up the device resources * i40iw_deinit_device - clean up the device resources
* @iwdev: iwarp device * @iwdev: iwarp device
* @reset: true if called before reset * @reset: true if called before reset
* @del_hdl: true if delete hdl entry
* *
* Destroy the ib device interface, remove the mac ip entry and ipv4/ipv6 addresses, * Destroy the ib device interface, remove the mac ip entry and ipv4/ipv6 addresses,
* destroy the device queues and free the pble and the hmc objects * destroy the device queues and free the pble and the hmc objects
*/ */
static void i40iw_deinit_device(struct i40iw_device *iwdev, bool reset, bool del_hdl) static void i40iw_deinit_device(struct i40iw_device *iwdev, bool reset)
{ {
struct i40e_info *ldev = iwdev->ldev; struct i40e_info *ldev = iwdev->ldev;
...@@ -1492,7 +1491,6 @@ static void i40iw_deinit_device(struct i40iw_device *iwdev, bool reset, bool del ...@@ -1492,7 +1491,6 @@ static void i40iw_deinit_device(struct i40iw_device *iwdev, bool reset, bool del
break; break;
} }
if (del_hdl)
i40iw_del_handler(i40iw_find_i40e_handler(ldev)); i40iw_del_handler(i40iw_find_i40e_handler(ldev));
kfree(iwdev->hdl); kfree(iwdev->hdl);
} }
...@@ -1658,7 +1656,7 @@ static int i40iw_open(struct i40e_info *ldev, struct i40e_client *client) ...@@ -1658,7 +1656,7 @@ static int i40iw_open(struct i40e_info *ldev, struct i40e_client *client)
} while (0); } while (0);
i40iw_pr_err("status = %d last completion = %d\n", status, iwdev->init_state); i40iw_pr_err("status = %d last completion = %d\n", status, iwdev->init_state);
i40iw_deinit_device(iwdev, false, false); i40iw_deinit_device(iwdev, false);
return -ERESTART; return -ERESTART;
} }
...@@ -1736,7 +1734,7 @@ static void i40iw_close(struct i40e_info *ldev, struct i40e_client *client, bool ...@@ -1736,7 +1734,7 @@ static void i40iw_close(struct i40e_info *ldev, struct i40e_client *client, bool
iwdev = &hdl->device; iwdev = &hdl->device;
destroy_workqueue(iwdev->virtchnl_wq); destroy_workqueue(iwdev->virtchnl_wq);
i40iw_deinit_device(iwdev, reset, true); i40iw_deinit_device(iwdev, reset);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment