Commit 682d11d7 authored by Harshitha Ramamurthy's avatar Harshitha Ramamurthy Committed by Jeff Kirsher

i40e: Initialize pointer in client_release function

The function i40e_client_release has a print statement that uses an
adapter pointer which is not initialized if a previous if statement
is not true. Hence, intialize it in the right place.

Change-ID: I1afdaa2c46771ac42be56edcc41bb56b455b06c8
Signed-off-by: default avatarHarshitha Ramamurthy <harshitha.ramamurthy@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 91cdca4f
...@@ -662,7 +662,7 @@ int i40e_lan_del_device(struct i40e_pf *pf) ...@@ -662,7 +662,7 @@ int i40e_lan_del_device(struct i40e_pf *pf)
static int i40e_client_release(struct i40e_client *client) static int i40e_client_release(struct i40e_client *client)
{ {
struct i40e_client_instance *cdev, *tmp; struct i40e_client_instance *cdev, *tmp;
struct i40e_pf *pf = NULL; struct i40e_pf *pf;
int ret = 0; int ret = 0;
LIST_HEAD(cdevs_tmp); LIST_HEAD(cdevs_tmp);
...@@ -672,12 +672,12 @@ static int i40e_client_release(struct i40e_client *client) ...@@ -672,12 +672,12 @@ static int i40e_client_release(struct i40e_client *client)
if (strncmp(cdev->client->name, client->name, if (strncmp(cdev->client->name, client->name,
I40E_CLIENT_STR_LENGTH)) I40E_CLIENT_STR_LENGTH))
continue; continue;
pf = (struct i40e_pf *)cdev->lan_info.pf;
if (test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state)) { if (test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state)) {
if (atomic_read(&cdev->ref_cnt) > 0) { if (atomic_read(&cdev->ref_cnt) > 0) {
ret = I40E_ERR_NOT_READY; ret = I40E_ERR_NOT_READY;
goto out; goto out;
} }
pf = (struct i40e_pf *)cdev->lan_info.pf;
if (client->ops && client->ops->close) if (client->ops && client->ops->close)
client->ops->close(&cdev->lan_info, client, client->ops->close(&cdev->lan_info, client,
false); false);
......
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