From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kalle Valo Subject: Re: [PATCH 3/5] mt76: fix a leaked reference by adding a missing of_node_put Date: Thu, 28 Feb 2019 08:39:04 +0000 (UTC) Message-ID: <20190228083905.4B85260EA5@smtp.codeaurora.org> References: <1550819742-32155-3-git-send-email-wen.yang99@zte.com.cn> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1550819742-32155-3-git-send-email-wen.yang99@zte.com.cn> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org Cc: wang.yi59@zte.com.cn, andrew@lunn.ch, alexandre.belloni@bootlin.com, f.fainelli@gmail.com, michal.simek@xilinx.com, netdev@vger.kernel.org, linus.walleij@linaro.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, davem@davemloft.net, Wen Yang , matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org, anirudh@xilinx.com, lorenzo.bianconi83@gmail.com, UNGLinuxDriver@microchip.com, John.Linn@xilinx.com, vivien.didelot@gmail.com, linux-arm-kernel@lists.infradead.org, nbd@nbd.name List-Id: linux-mediatek@lists.infradead.org Wen Yang wrote: > The call to of_find_node_by_phandle returns a node pointer with refcount > incremented thus it must be explicitly decremented after the last > usage. > > Detected by coccinelle with the following warnings: > ./drivers/net/wireless/mediatek/mt76/eeprom.c:58:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 48, but without a corresponding object release within this function. > ./drivers/net/wireless/mediatek/mt76/eeprom.c:61:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 48, but without a corresponding object release within this function. > ./drivers/net/wireless/mediatek/mt76/eeprom.c:67:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 48, but without a corresponding object release within this function. > ./drivers/net/wireless/mediatek/mt76/eeprom.c:70:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 48, but without a corresponding object release within this function. > ./drivers/net/wireless/mediatek/mt76/eeprom.c:72:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 48, but without a corresponding object release within this function. > > Signed-off-by: Wen Yang > Cc: Felix Fietkau > Cc: Lorenzo Bianconi > Cc: Kalle Valo > Cc: "David S. Miller" > Cc: Matthias Brugger > Cc: linux-wireless@vger.kernel.org > Cc: netdev@vger.kernel.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-mediatek@lists.infradead.org > Cc: linux-kernel@vger.kernel.org Patch applied to wireless-drivers-next.git, thanks. 34e022d8b780 mt76: fix a leaked reference by adding a missing of_node_put -- https://patchwork.kernel.org/patch/10825315/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches 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 X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B06E2C43381 for ; Thu, 28 Feb 2019 08:39:15 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 2282A2133D for ; Thu, 28 Feb 2019 08:39:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="H41Ee0tQ"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="jo6A6GYY"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="NiLBJja8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2282A2133D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:To:References: In-Reply-To:From:Subject:MIME-Version:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JvO2wguEqzj5nkx63xvHJ08f3qC9WD523WpUoxYl7BQ=; b=H41Ee0tQWGRxDE XXeON/tSuw6MVDl+Gbs31PWiWn2ZIWalQR4y+jOlmgB27FLPjV4Plh0Wh2wuJ8h/74RDodlSybgwX v/qzj71cNRnr5r48jsxkvIFkP550/6KRa+I1467NfhYkjsEWc5bnKF5fvYDcL0wjZK/G4+S4rOJ1u fADw12F/4CWb9z7J1zjA9QuXm+s3RkcWmLMINx+/USh5Mil1Q6hZu1W0ju1L4l55hMZYbuANC1Dfh yNfYg/ANkoDI4iAQBHvFzHcvR8PNd49cFlMRg0UpPjbDhXPL5tNv1wX0XyYpGNQWUpwFm5NPAyeKp 31Etvdg3j8mTy1GC1YNA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzHDi-0008WB-8Q; Thu, 28 Feb 2019 08:39:10 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzHDf-0008Vm-2V; Thu, 28 Feb 2019 08:39:08 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4B85260EA5; Thu, 28 Feb 2019 08:39:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1551343145; bh=6oGjoUb6vPV6mXBqiIySFbbskd5JDkOO7r7AqQsM+8M=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=jo6A6GYYtEFhqM9JfTxCE4JAfnLvmDGigCDC5Gy1dIAdhha4J1jjw/MEDboDWMLRl /2zk6u6mo2G0PVEJ7Pa26N5F2x0EJBmntNq8/zC+Puj6fhq1qn/dWiL/ZrU2KHh2QL tuvbPnbmirkVejpGqTeBzzuMljoTUwXPVaAcTlFQ= Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kvalo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 94E2B608CE; Thu, 28 Feb 2019 08:38:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1551343143; bh=6oGjoUb6vPV6mXBqiIySFbbskd5JDkOO7r7AqQsM+8M=; h=Subject:From:In-Reply-To:References:To:Cc:From; b=NiLBJja8px4RzW7V2HuzTLV20UOZj8gds6SLwZIVU/qjzVjBa86j8C+SvZqS1b5ca DmlgM2aJ1fqDLG2TDivC06tbKvXO9y7XRiXXGLH7Xxmt5hQCN+XV+kU/M0YWlnKrZG DFIicHwIxoc9sA+YqY/be5xQs2zFGzT6T9EXAhDU= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 94E2B608CE Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kvalo@codeaurora.org MIME-Version: 1.0 Subject: Re: [PATCH 3/5] mt76: fix a leaked reference by adding a missing of_node_put From: Kalle Valo In-Reply-To: <1550819742-32155-3-git-send-email-wen.yang99@zte.com.cn> References: <1550819742-32155-3-git-send-email-wen.yang99@zte.com.cn> To: Wen Yang User-Agent: pwcli/0.0.0-git (https://github.com/kvalo/pwcli/) Python/2.7.12 Message-Id: <20190228083905.4B85260EA5@smtp.codeaurora.org> Date: Thu, 28 Feb 2019 08:39:04 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190228_003907_149670_1624D89F X-CRM114-Status: UNSURE ( 9.05 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: wang.yi59@zte.com.cn, andrew@lunn.ch, alexandre.belloni@bootlin.com, f.fainelli@gmail.com, michal.simek@xilinx.com, netdev@vger.kernel.org, linus.walleij@linaro.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, davem@davemloft.net, Wen Yang , matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org, anirudh@xilinx.com, lorenzo.bianconi83@gmail.com, UNGLinuxDriver@microchip.com, John.Linn@xilinx.com, vivien.didelot@gmail.com, linux-arm-kernel@lists.infradead.org, nbd@nbd.name Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Wen Yang wrote: > The call to of_find_node_by_phandle returns a node pointer with refcount > incremented thus it must be explicitly decremented after the last > usage. > > Detected by coccinelle with the following warnings: > ./drivers/net/wireless/mediatek/mt76/eeprom.c:58:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 48, but without a corresponding object release within this function. > ./drivers/net/wireless/mediatek/mt76/eeprom.c:61:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 48, but without a corresponding object release within this function. > ./drivers/net/wireless/mediatek/mt76/eeprom.c:67:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 48, but without a corresponding object release within this function. > ./drivers/net/wireless/mediatek/mt76/eeprom.c:70:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 48, but without a corresponding object release within this function. > ./drivers/net/wireless/mediatek/mt76/eeprom.c:72:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 48, but without a corresponding object release within this function. > > Signed-off-by: Wen Yang > Cc: Felix Fietkau > Cc: Lorenzo Bianconi > Cc: Kalle Valo > Cc: "David S. Miller" > Cc: Matthias Brugger > Cc: linux-wireless@vger.kernel.org > Cc: netdev@vger.kernel.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-mediatek@lists.infradead.org > Cc: linux-kernel@vger.kernel.org Patch applied to wireless-drivers-next.git, thanks. 34e022d8b780 mt76: fix a leaked reference by adding a missing of_node_put -- https://patchwork.kernel.org/patch/10825315/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel