Commit 931d0a8b authored by Dan Carpenter's avatar Dan Carpenter Committed by Jakub Kicinski

net: fman: memac: Uninitialized variable on error path

The "fixed_link" is only allocated sometimes but it's freed
unconditionally in the error handling.  Set it to NULL so we don't free
uninitialized data.

Fixes: 9ea4742a ("net: fman: Configure fixed link in memac_initialization")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarSean Anderson <sean.anderson@seco.com>
Link: https://lore.kernel.org/r/Ywd2X6gdKmTfYBxD@kiliSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 7dea06db
......@@ -389,7 +389,7 @@ static int memac_initialization(struct mac_device *mac_dev,
{
int err;
struct fman_mac_params params;
struct fixed_phy_status *fixed_link;
struct fixed_phy_status *fixed_link = NULL;
mac_dev->set_promisc = memac_set_promiscuous;
mac_dev->change_addr = memac_modify_mac_address;
......
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