mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon@ti.com>
To: Muhammad Usama Anjum <musamaanjum@gmail.com>,
	Vinod Koul <vkoul@kernel.org>,
	"open list:GENERIC PHY FRAMEWORK" <linux-phy@lists.infradead.org>,
	open list <linux-kernel@vger.kernel.org>,
	<kernel-janitors@vger.kernel.org>, <colin.king@canonical.com>,
	<dan.carpenter@oracle.com>
Subject: Re: [Discussion] Uninitialized variable in wiz_mode_select()
Date: Thu, 1 Apr 2021 13:09:34 +0530	[thread overview]
Message-ID: <0ac860d1-15b5-b314-c694-750db6274aa5@ti.com> (raw)
In-Reply-To: <aaa035d2-95a7-00b3-ef76-1aa61c7f8da9@ti.com>

Hi,

On 01/04/21 1:08 pm, Kishon Vijay Abraham I wrote:
> Hi Usama,
> 
> On 01/04/21 1:03 pm, Muhammad Usama Anjum wrote:
>> 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;
> 
> I've sent a follow-up patch fixing this.
> http://lor.kernel.org/r/20210331131417.15596-1-kishon@ti.com

Fixed a typo in the link
https://lore.kernel.org/linux-phy/20210331131417.15596-1-kishon@ti.com/

Thanks
Kishon

      reply	other threads:[~2021-04-01  7:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01  7:33 Muhammad Usama Anjum
2021-04-01  7:38 ` Kishon Vijay Abraham I
2021-04-01  7:39   ` Kishon Vijay Abraham I [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0ac860d1-15b5-b314-c694-750db6274aa5@ti.com \
    --to=kishon@ti.com \
    --cc=colin.king@canonical.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=musamaanjum@gmail.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®