[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <943b92c6ac291726cf0e6bd92e88f2110c14b74c.camel@gmail.com>
Date: Thu, 01 Apr 2021 12:33:46 +0500
From: Muhammad Usama Anjum <musamaanjum@...il.com>
To: Kishon Vijay Abraham I <kishon@...com>,
Vinod Koul <vkoul@...nel.org>,
"open list:GENERIC PHY FRAMEWORK" <linux-phy@...ts.infradead.org>,
open list <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org, colin.king@...onical.com,
dan.carpenter@...cle.com
Cc: musamaanjum@...il.com
Subject: [Discussion] Uninitialized variable in wiz_mode_select()
Hi,
`mode` remains uninitialized when `lane_phy_type` isn't PHY_TYPE_DP
or
PHY_TYPE_QSGMII. I've checked the dtsi (k3-j721e-common-proc-
board.dts)
and possible values of `lane_phy_type` are justPHY_TYPE_USB3 and
PHY_TYPE_PCIE. If this is correct, the mode will remain uninitialized with
garbage value. `mode` should be initialized to what? It seems like it is highly
implementation dependent.
/drivers/phy/ti/phy-j721e-wiz.c: 344 in wiz_mode_select()
338 for (i = 0; i < num_lanes; i++) {
339 if (wiz->lane_phy_type[i] == PHY_TYPE_DP)
340 mode = LANE_MODE_GEN1;
341 else if (wiz->lane_phy_type[i] == PHY_TYPE_QSGMII)
342 mode = LANE_MODE_GEN2;
343
>>> CID 1503592: Uninitialized variables (UNINIT)
>>> Using uninitialized value "mode" when calling "regmap_field_write".
344 ret = regmap_field_write(wiz->p_standard_mode[i], mode);
345 if (ret)
346 return ret;
347 }
348
349 return 0;
Thanks,
Usama
Powered by blists - more mailing lists