linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Coverity: mt7921_check_offload_capability(): Resource leaks
@ 2022-12-02 22:21 coverity-bot
  0 siblings, 0 replies; only message in thread
From: coverity-bot @ 2022-12-02 22:21 UTC (permalink / raw)
  To: Sean Wang
  Cc: YN Chen, Lorenzo Bianconi, linux-wireless, Jakub Kicinski,
	Kalle Valo, Matthias Brugger, Shayne Chen, Eric Dumazet,
	Leon Yen, linux-arm-kernel, netdev, Deren Wu, Kai-Heng Feng,
	Johannes Berg, Quan Zhou, linux-mediatek, Felix Fietkau,
	David S. Miller, linux-kernel, Paolo Abeni, Ben Greear,
	Ming Yen Hsieh, Ryder Lee, Gustavo A. R. Silva, linux-next,
	linux-hardening

Hello!

This is an experimental semi-automated report about issues detected by
Coverity from a scan of next-20221202 as part of the linux-next scan project:
https://scan.coverity.com/projects/linux-next-weekly-scan

You're getting this email because you were associated with the identified
lines of code (noted below) that were touched by commits:

  Thu Dec 1 17:29:13 2022 +0100
    034ae28b56f1 ("wifi: mt76: mt7921: introduce remain_on_channel support")

Coverity reported the following:

*** CID 1527806:  Resource leaks  (RESOURCE_LEAK)
drivers/net/wireless/mediatek/mt76/mt7921/init.c:178 in mt7921_check_offload_capability()
172     	ret = request_firmware(&fw, fw_wm, dev);
173     	if (ret)
174     		return ret;
175
176     	if (!fw || !fw->data || fw->size < sizeof(*hdr)) {
177     		dev_err(dev, "Invalid firmware\n");
vvv     CID 1527806:  Resource leaks  (RESOURCE_LEAK)
vvv     Variable "fw" going out of scope leaks the storage it points to.
178     		return -EINVAL;
179     	}
180
181     	data = fw->data;
182     	hdr = (const void *)(fw->data + fw->size - sizeof(*hdr));
183

If this is a false positive, please let us know so we can mark it as
such, or teach the Coverity rules to be smarter. If not, please make
sure fixes get into linux-next. :) For patches fixing this, please
include these lines (but double-check the "Fixes" first):

Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1527806 ("Resource leaks")
Fixes: 034ae28b56f1 ("wifi: mt76: mt7921: introduce remain_on_channel support")

Thanks for your attention!

-- 
Coverity-bot

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-02 22:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-02 22:21 Coverity: mt7921_check_offload_capability(): Resource leaks coverity-bot

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).