提交 931d0a8b 编写于 作者: D Dan Carpenter 提交者: 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: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NSean Anderson <sean.anderson@seco.com>
Link: https://lore.kernel.org/r/Ywd2X6gdKmTfYBxD@kiliSigned-off-by: NJakub Kicinski <kuba@kernel.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册