Skip to content

Commit 7be147d

Browse files
jacob-kellerJeff Kirsher
authored andcommitted
i40e: initialize params before notifying of l2_param_changes
Probably due to some mis-merging fix a bug associated with commits d7ce642 ("i40e: don't check params until after checking for client instance", 2017-02-09) and 3140aa9a78c9 ("i40e: KISS the client interface", 2017-03-14) The first commit tried to move the initialization of the params structure so that we didn't bother doing this if we didn't have a client interface. You can already see that it looks fishy because of the indentation. The second commit refactors a bunch of the interface, and incorrectly drops the params initialization. I believe what occurred is that internally the two patches were re-ordered, and the merge conflicts as a result were performed incorrectly. Fix the use of an uninitialized variable by correctly initializing the params variable via i40e_client_get_params(). Reported-by: Colin Ian King <[email protected]> Signed-off-by: Jacob Keller <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 703ba88 commit 7be147d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/ethernet/intel/i40e/i40e_client.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ void i40e_notify_client_of_l2_param_changes(struct i40e_vsi *vsi)
147147
dev_dbg(&vsi->back->pdev->dev, "Client is not open, abort l2 param change\n");
148148
return;
149149
}
150+
memset(&params, 0, sizeof(params));
151+
i40e_client_get_params(vsi, &params);
150152
memcpy(&cdev->lan_info.params, &params, sizeof(struct i40e_params));
151153
cdev->client->ops->l2_param_change(&cdev->lan_info, cdev->client,
152154
&params);

0 commit comments

Comments
 (0)