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 DAB04C4332F for ; Fri, 2 Dec 2022 22:27:15 +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=LNyJnHyRAWJOohPtt08Jlclyyv7OVqyHI7V8C0uB5d0=; b=GKRNM57MRU/voG WAUODm7Ax8Ir7XDgUgkV3+VlsAqItyXIhw4JgBWi+3hdvlzJXzFqeWYgQev7OJZqVVYiFD6wRxe0U Jq+UH9XvJQO2AF7TJStSpztV6QzFFBYU4BRnYG26nsHzbj7xcmEaaFboS0xxVgXHkoCXheboJsp2e Njjvx8UbzIIrWIwyQp2JDZ7VHlvbt+xDGJgRJ2lbXWRT2ypKPhnokKa8OkcU8DFZK7nTrrwNDnyCf TCMFTe9UsdSZXNXDThWFKymNUB/YUTn/1bbxvjbdOw56SjqNddaJX+kZwj/3CcwRW/AJBDhBAywgW FP+9nssclRvNlvMctERg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1EU7-001W27-9j; Fri, 02 Dec 2022 22:26:19 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1EU4-001W10-2T for linux-arm-kernel@lists.infradead.org; Fri, 02 Dec 2022 22:26:17 +0000 Received: by mail-pj1-x1034.google.com with SMTP id l22-20020a17090a3f1600b00212fbbcfb78so9562651pjc.3 for ; Fri, 02 Dec 2022 14:26:14 -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=yt6U61saWMCsM6WunZD+lQTQ9rMom+0MKUGAGbXh2To=; b=JpkNSnUTQREjjU9X/9QyMGlgjT/ma/hBiV5HrI0DcxE2Idct0EzQS0SPud8jNOc4+y fXMXZoENWijXmad/5W89LY3KmeTspX126DxZCyiKxuGu7IPFcGkSTw/ysnfS7+GLRNUc hpzjNdf+6K6vfsBpzuGOOMwwpfTw94FefHU4M= 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=yt6U61saWMCsM6WunZD+lQTQ9rMom+0MKUGAGbXh2To=; b=pYquxfL6BGAnMVgN0OwfOX6NNXbYnxbCkigUOH8KhUqVmdZGiNJKuBrGGs9WsBbAtL 8b2t5viiWXLs0iQqPtX9mPvKIzAUCk6bKvbUHFaqPOovv0FRMmOVsyRIt25MZfLIAoKA ftmp+wtTVpa1LwHOYxfR8xu+CFWJh5G+JaBFP75Q8sXUeKYkLDpPONtoIwycRsfx9MF1 VXqTyJmwFXBlqqVvVHQq794L+Xr6NM4jvWoynuDSReViRMUXHG9yJDBbN40mPaRuJ/8p hYd7ErM8qPryxtdDJfYlM1p+sWdM8dfRjoyuXJVSb47E36vq4uytYZjopNKq/g4TvKid 6sbw== X-Gm-Message-State: ANoB5pmwb/0I/ugvs/3Cw4RQp8AitigsS/it0C5IllTh1PUY0NHKaPkS MkoL57sUxRJbZZYeGhEHi69vGA== X-Google-Smtp-Source: AA0mqf5hBB6FtCKudJpUxOEaTUIc1ooouR7B5mUlnUXJWd9jB2xbI+K89flhWre2qJUd9p1XkrgzFw== X-Received: by 2002:a17:90b:4b89:b0:213:d2c:1923 with SMTP id lr9-20020a17090b4b8900b002130d2c1923mr20326111pjb.234.1670019974390; Fri, 02 Dec 2022 14:26:14 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id w81-20020a627b54000000b0057255b7c8easm5570259pfc.33.2022.12.02.14.26.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 14:26:13 -0800 (PST) From: coverity-bot X-Google-Original-From: coverity-bot Date: Fri, 2 Dec 2022 14:26:12 -0800 To: Ryder Lee Cc: Lorenzo Bianconi , linux-wireless@vger.kernel.org, Jakub Kicinski , Kalle Valo , Matthias Brugger , Shayne Chen , Eric Dumazet , linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, Felix Fietkau , "David S. Miller" , linux-kernel@vger.kernel.org, MeiChia Chiu , Paolo Abeni , Sean Wang , Bo Jiao , Sujuan Chen , "Gustavo A. R. Silva" , linux-next@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Coverity: mt7915_rate_txpower_get(): Resource leaks Message-ID: <202212021426.BE8F5215@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_142616_139313_3A13D1F7 X-CRM114-Status: UNSURE ( 7.73 ) 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:14 2022 +0100 bd2404d42821 ("wifi: mt76: mt7915: add basedband Txpower info into debugfs") Coverity reported the following: *** CID 1527799: Resource leaks (RESOURCE_LEAK) drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c:999 in mt7915_rate_txpower_get() 993 buf = kzalloc(sz, GFP_KERNEL); 994 if (!buf) 995 return -ENOMEM; 996 997 ret = mt7915_mcu_get_txpower_sku(phy, txpwr, sizeof(txpwr)); 998 if (ret) vvv CID 1527799: Resource leaks (RESOURCE_LEAK) vvv Variable "buf" going out of scope leaks the storage it points to. 999 return ret; 1000 1001 /* Txpower propagation path: TMAC -> TXV -> BBP */ 1002 len += scnprintf(buf + len, sz - len, 1003 "\nPhy%d Tx power table (channel %d)\n", 1004 phy != &dev->phy, phy->mt76->chandef.chan->hw_value); 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: 1527799 ("Resource leaks") Fixes: bd2404d42821 ("wifi: mt76: mt7915: add basedband Txpower info into debugfs") 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