From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 684EDC4332F for ; Fri, 2 Dec 2022 22:22:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To: Date:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=crjeq+U2FOYi8SfzY06FqGClZixs3HzqKJ0E4+eX0Gg=; b=wPIeReH0SJr6t9 HaKJjv7eFzAAMXBeOV/OJ1DlwR3JqdeT6I7VErXbQQ4Ad00Mqal9lBfK9pCEevsnRHRSPpgFeBwuN /K5eNhBlEls4JlncHK6KcIxKvdwMCEXUasWscb/HpJWasFFj0MEzhYSEawdpHXjCpgEmJyKakq9Vx lhlQfa42Z6xYX86o+8WvaEGSRknx/06uRcGa/yHst6HMG4CvJqckRHf4axTaXfYKdWaNYWPrIXBPm mSbMJnCpx2C4XBnzpscGw1Q9EZzVTKKUhGtkudo3J7jU/sl04t+XSgqa0sP2wv4Mnp0u3jKzO5CYD 1keggJCz2faP07agkgFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1EPn-001VEa-O4; Fri, 02 Dec 2022 22:21:51 +0000 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1EPl-001VDw-5r for linux-arm-kernel@lists.infradead.org; Fri, 02 Dec 2022 22:21:50 +0000 Received: by mail-pf1-x42a.google.com with SMTP id 124so6207264pfy.0 for ; Fri, 02 Dec 2022 14:21:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-disposition:mime-version:message-id:subject:cc:to:date:from :from:to:cc:subject:date:message-id:reply-to; bh=aMS0b2RE+vIHMOYP2E8EZZmUlghR9trNposIEeXjKJI=; b=GNTcUDsFn03JscGIy0a+vYklYFfFxJZZqGpErbZZkJXfUy51L4mNHn15JV39Wn01z3 vb4zrIv5tFVn1hMThrwS+Z1/O+pe9nX5VyfbHAqFsufDYe/6mHsHteF9gFgr7BbTHhZt kdAMU2oSGR44L1sJjQuBc7Zg+9UiSLhcbzifE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aMS0b2RE+vIHMOYP2E8EZZmUlghR9trNposIEeXjKJI=; b=bvhyNUeCYypg19/Y8Mv+vYGm1b1z8VrTcQxy1XfEG/N+UW7ACDUUdIZafy3PjwPxqT vBRWE9WX+HKZBWY/HroBnF8XvB7itlmvRz6BReCLvJ6GrHPCwwxq/PAAYzG27NK8g8th LuD5cV9wmtp4u+HrcGQMgDZr8pe3BNmkxaOr7se1QrGP2CkIJZe70MgxFMRSI52fzCox Q37fUNbc9F1zRdXJ94gLAfa50XhAzsGYPd21scKrSyzW0+z2bypnrk0NXiOxIe/nGTQJ nCvV/Vyc1rlKU5NHtc/a/FPaFxIsX0EIxDnue/pyabbWdlOMW/iLE5zYmYMk7Ebi/Xyp aqTQ== X-Gm-Message-State: ANoB5pkHGWizgUHiR96DjYVuf3/9EMapRXlqVXOrrxxBxT0vaUREbYMi 8f/dI/SRif0BamaiOiH1eT30zA== X-Google-Smtp-Source: AA0mqf793ESx/sscIPyNmg7Zc2YStJKUoN2l9l7kbnO18Sros+YI1MVyANNMCuAajv/r7OdyYX7R0A== X-Received: by 2002:a05:6a00:3029:b0:576:6bff:1c61 with SMTP id ay41-20020a056a00302900b005766bff1c61mr3817196pfb.15.1670019708300; Fri, 02 Dec 2022 14:21:48 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id t15-20020a170902e84f00b00188c9c11559sm6123882plg.1.2022.12.02.14.21.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 14:21:47 -0800 (PST) From: coverity-bot X-Google-Original-From: coverity-bot Date: Fri, 2 Dec 2022 14:21:46 -0800 To: Sean Wang Cc: YN Chen , Lorenzo Bianconi , linux-wireless@vger.kernel.org, Jakub Kicinski , Kalle Valo , Matthias Brugger , Shayne Chen , Eric Dumazet , Leon Yen , linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, Deren Wu , Kai-Heng Feng , Johannes Berg , Quan Zhou , linux-mediatek@lists.infradead.org, Felix Fietkau , "David S. Miller" , linux-kernel@vger.kernel.org, Paolo Abeni , Ben Greear , Ming Yen Hsieh , Ryder Lee , "Gustavo A. R. Silva" , linux-next@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Coverity: mt7921_check_offload_capability(): Resource leaks Message-ID: <202212021421.6B6D4F45@keescook> MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221202_142149_256279_59CC20D1 X-CRM114-Status: UNSURE ( 7.56 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 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