Skip to content

Commit

Permalink
net: fman: memac: Uninitialized variable on error path
Browse files Browse the repository at this point in the history
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: 9ea4742 ("net: fman: Configure fixed link in memac_initialization")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Sean Anderson <sean.anderson@seco.com>
Link: https://lore.kernel.org/r/Ywd2X6gdKmTfYBxD@kili
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Dan Carpenter authored and Jakub Kicinski committed Aug 27, 2022
1 parent 7dea06d commit 931d0a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/freescale/fman/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 931d0a8

Please sign in to comment.