[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b9c3d76b-62b0-2956-2918-70161868af4c@seco.com>
Date: Thu, 25 Aug 2022 10:36:16 -0400
From: Sean Anderson <sean.anderson@...o.com>
To: Dan Carpenter <dan.carpenter@...cle.com>,
Madalin Bucur <madalin.bucur@....com>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Camelia Groza <camelia.groza@....com>, netdev@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH net-next] net: fman: memac: Uninitialized variable on
error path
On 8/25/22 10:32 AM, Sean Anderson wrote:
>
>
> On 8/25/22 9:17 AM, Dan Carpenter wrote:
>> 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: 9ea4742a55ca ("net: fman: Configure fixed link in memac_initialization")
>> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
>> ---
>> drivers/net/ethernet/freescale/fman/mac.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c
>> index c376b9bf657d..f9a3f85760fb 100644
>> --- a/drivers/net/ethernet/freescale/fman/mac.c
>> +++ b/drivers/net/ethernet/freescale/fman/mac.c
>> @@ -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;
>>
>
> This is also fixed by [1]
>
> --Sean
>
> [1] https://lore.kernel.org/netdev/20220818161649.2058728-10-sean.anderson@seco.com/
>
Whoops, I didn't read this correctly.
Reviewed-by: Sean Anderson <sean.anderson@...o.com>
Powered by blists - more mailing lists