From patchwork Tue Nov 9 03:29:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: CGEL X-Patchwork-Id: 12609665 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80C8AC433F5 for ; Tue, 9 Nov 2021 03:31:09 +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 3CA4C6115A for ; Tue, 9 Nov 2021 03:31:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3CA4C6115A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:Date:Subject:Cc :To: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=rEIeySwMIVuvCR+G8ldFpFyFVUzj/gSp2DsDw107+W8=; b=XFlkiI/hPzQKgQ cvt3FgMEsrDGH174jkXkZXKyL3JI/61oYJDMRmauS/sdcCnPxe1Ew75jPoFjAIRzouLX/jYfdv3As KcVd2gvtJszVfZY/mq2BwBJi6zyjA0o1MWquZ5JaBS3Rx+L7Dx8YBtDTRE2YtABopOmGqAfjfIYYM j2Zih6jsFe9oB7yxszZ2hDYDUhlVRAngyyu1UupQPNTtu5OJG0dYyNUwFPgqlNbWCnN1n4fB20Doo F0s4shUZncHN9A9kMKbRzOm+pIdpqN9z/vGq3pVGJHicdVyLGBYAhNGIOMiLZa8alb48m67CLz67A JhO5JEzsM4MpS/P6oUoQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkHpb-000bUc-M7; Tue, 09 Nov 2021 03:29:55 +0000 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkHpY-000bU8-EH for linux-arm-kernel@lists.infradead.org; Tue, 09 Nov 2021 03:29:53 +0000 Received: by mail-pg1-x52a.google.com with SMTP id b4so17143443pgh.10 for ; Mon, 08 Nov 2021 19:29:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OhZqPslPlwCnqLTI/WB7O6N7RveewfK/Aqs6JCnISYU=; b=RqpAOosE7XNYqdqnaB8/r2gGhpjrMkQfysk/L8Ytt/ZF5vTYcWVSl1c5X8sNeB1aMP LjzgQQRmUQIScLyS+/EerYc5dkJi82LuuAo6p4afIojfDgduzEWiKwmOI5Jz3/jZ3CZG b22soZicGXWe0xkFdfSXOjyEdhs4Cfq/Qvl0yt8mmBIcUuDMAd7XEZI8+Yq+GdgmmhwD ZhxUhIzphP367vFxDOZElYXsPWwod2nIkJBpzjNxv4ibftMeXceKT/RYWtW1j8+zB/Rw qLGznQk3m7NvWiIlvNgIrt468n6Cd7QuFQpvHPkJOHcu9SLYC6ak1eDQdY12xjkq2xdq /NtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OhZqPslPlwCnqLTI/WB7O6N7RveewfK/Aqs6JCnISYU=; b=b39TnGaQJlQkjLGHSp9bU4Jb+dJQNBRrgOJGsIRYLpwUNr0xc58xWoN/fpAiqNdwoW mjn42r9h1niRBFWz6hcmH5P8XBe9lARnrvpygw7dLUxLu062SmGoXtDH0mDe0NnLZxkz hfvHA+3hJ4432acf6AUP2/U73n+KQhgtqCaZDVajFec/nMVRL/nWFzgroxS2w9FS9qvM KkBAtMLyiEWVDUGZxH9V1ic5L3NcSHcqeBs3zHaePY8BZ77KcnbcyC8igSTNpWa2tUEB dsgtG3iZ7acuI1hdwuQIeUM2yNWkD7uIds4WjsrgJHBIp0ELlkyUuQgqwrgGfWU110Sa jSWQ== X-Gm-Message-State: AOAM533DV9JkSQxC0fKTx0xA49qmBEnrEYBDbm/SwvQSUseYnjSOqIiT JCzs6qTAkvKBD0Z9lq3xkEk= X-Google-Smtp-Source: ABdhPJyMqm9opwSeavzaK+7vIeiMXlwiPNWB+4JEFYopvyZ3+XzP5wPMtcn6G6FGVammOWS8oJFBTg== X-Received: by 2002:aa7:82c2:0:b0:49f:9e1a:7da3 with SMTP id f2-20020aa782c2000000b0049f9e1a7da3mr4349775pfn.60.1636428591118; Mon, 08 Nov 2021 19:29:51 -0800 (PST) Received: from localhost.localdomain ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id c8sm7857959pgh.23.2021.11.08.19.29.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 19:29:50 -0800 (PST) From: cgel.zte@gmail.com X-Google-Original-From: ye.guojin@zte.com.cn To: f.fainelli@gmail.com Cc: tglx@linutronix.de, maz@kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ye Guojin , Zeal Robot Subject: [PATCH] irqchip/irq-bcm7120-l2: add put_device() after of_find_device_by_node() Date: Tue, 9 Nov 2021 03:29:43 +0000 Message-Id: <20211109032943.129855-1-ye.guojin@zte.com.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211108_192952_517948_12270FBD X-CRM114-Status: GOOD ( 12.25 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Ye Guojin This was found by coccicheck: ./drivers/irqchip/irq-bcm7120-l2.c,328,1-7,ERROR missing put_device; call of_find_device_by_node on line 234, but without a corresponding object release within this function. ./drivers/irqchip/irq-bcm7120-l2.c,341,1-7,ERROR missing put_device; call of_find_device_by_node on line 234, but without a corresponding object release within this function. Addtionally, fixup the potential problem that memory is not released before return. Reported-by: Zeal Robot Signed-off-by: Ye Guojin --- drivers/irqchip/irq-bcm7120-l2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-bcm7120-l2.c b/drivers/irqchip/irq-bcm7120-l2.c index d80e67a6aad2..aaa70619f3c0 100644 --- a/drivers/irqchip/irq-bcm7120-l2.c +++ b/drivers/irqchip/irq-bcm7120-l2.c @@ -325,7 +325,7 @@ static int __init bcm7120_l2_intc_probe(struct device_node *dn, pr_info("registered %s intc (%pOF, parent IRQ(s): %d)\n", intc_name, dn, data->num_parent_irqs); - return 0; + ret = 0; out_free_domain: irq_domain_remove(data->domain); @@ -336,6 +336,7 @@ static int __init bcm7120_l2_intc_probe(struct device_node *dn, if (data->map_base[idx]) iounmap(data->map_base[idx]); } + put_device(&pdev->dev); out_free_data: kfree(data); return ret;