From: Kalle Valo <kvalo@kernel.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: kbuild@lists.01.org, Wen Gong <quic_wgong@quicinc.com>,
lkp@intel.com, kbuild-all@lists.01.org,
ath11k@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [kvalo-ath:pending 52/56] drivers/net/wireless/ath/ath11k/wmi.c:5651 ath11k_wmi_tlv_fw_stats_data_parse() error: uninitialized symbol 'len'.
Date: Tue, 11 Jan 2022 16:26:38 +0200 [thread overview]
Message-ID: <874k6auz4x.fsf@kernel.org> (raw)
In-Reply-To: <20220111135805.GL1978@kadam> (Dan Carpenter's message of "Tue, 11 Jan 2022 16:58:05 +0300")
Dan Carpenter <dan.carpenter@oracle.com> writes:
> On Tue, Jan 11, 2022 at 03:35:26PM +0200, Kalle Valo wrote:
>> > bc5c448b70ff14 Wen Gong 2021-12-08 5629 static int
>> > ath11k_wmi_tlv_fw_stats_data_parse(struct ath11k_base *ab,
>> > bc5c448b70ff14 Wen Gong 2021-12-08 5630 struct wmi_tlv_fw_stats_parse
>> > *parse,
>> > bc5c448b70ff14 Wen Gong 2021-12-08 5631 const void *ptr)
>> > bc5c448b70ff14 Wen Gong 2021-12-08 5632 {
>> > bc5c448b70ff14 Wen Gong 2021-12-08 5633 struct ath11k_fw_stats *stats
>> > = parse->stats;
>> > bc5c448b70ff14 Wen Gong 2021-12-08 5634 const struct wmi_stats_event
>> > *ev = parse->ev;
>> > bc5c448b70ff14 Wen Gong 2021-12-08 5635 int i;
>> > bc5c448b70ff14 Wen Gong 2021-12-08 5636 const void *data = ptr;
>> > bc5c448b70ff14 Wen Gong 2021-12-08 5637 u32 len;
> ^^^^^^^^
> "len" is a local variable, not a parameter.
Ah, I only looked at the current ath-next branch.
>> > bc5c448b70ff14 Wen Gong 2021-12-08 5638
>> > bc5c448b70ff14 Wen Gong 2021-12-08 5639 if (!ev) {
>> > bc5c448b70ff14 Wen Gong 2021-12-08 5640 ath11k_warn(ab, "failed to
>> > fetch update stats ev");
>> > bc5c448b70ff14 Wen Gong 2021-12-08 5641 return -EPROTO;
>> > bc5c448b70ff14 Wen Gong 2021-12-08 5642 }
>> > d5c65159f28953 Kalle Valo 2019-11-23 5643
>> > d5c65159f28953 Kalle Valo 2019-11-23 5644 stats->stats_id = 0;
>> > d5c65159f28953 Kalle Valo 2019-11-23 5645
>> > d5c65159f28953 Kalle Valo 2019-11-23 5646 for (i = 0; i <
>> > ev->num_pdev_stats; i++) {
>> > d5c65159f28953 Kalle Valo 2019-11-23 5647 const struct wmi_pdev_stats
>> > *src;
>> > d5c65159f28953 Kalle Valo 2019-11-23 5648 struct ath11k_fw_stats_pdev
>> > *dst;
>> > d5c65159f28953 Kalle Valo 2019-11-23 5649
>> > d5c65159f28953 Kalle Valo 2019-11-23 5650 src = data;
>> > bc5c448b70ff14 Wen Gong 2021-12-08 @5651 if (len < sizeof(*src))
>> >
>> > "len" is never initialized.
>>
>> I only quickly looked at this, but AFAICS ath11k_wmi_tlv_iter() provides
>> len to ath11k_wmi_tlv_fw_stats_parse() which again provides len to
>> ath11k_wmi_tlv_fw_stats_data_parse(). I'm not seeing how this is
>> uninitalised, did I miss something?
>
> I think the bug was fixed and the tree was rebased?
Most likely there were some changes, but I can't remember anymore. Too
many patches :)
> I only look at the email and hit forward and the code in the email was
> clearly buggy but tree looks okay now as you say.
Good, thanks for checking.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
prev parent reply other threads:[~2022-01-11 14:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-05 12:21 [kvalo-ath:pending 52/56] drivers/net/wireless/ath/ath11k/wmi.c:5651 ath11k_wmi_tlv_fw_stats_data_parse() error: uninitialized symbol 'len' Dan Carpenter
2022-01-11 13:35 ` Kalle Valo
2022-01-11 13:58 ` Dan Carpenter
2022-01-11 14:26 ` Kalle Valo [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=874k6auz4x.fsf@kernel.org \
--to=kvalo@kernel.org \
--cc=ath11k@lists.infradead.org \
--cc=dan.carpenter@oracle.com \
--cc=kbuild-all@lists.01.org \
--cc=kbuild@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=quic_wgong@quicinc.com \
/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;
as well as URLs for NNTP newsgroup(s).