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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D315C433EF for ; Tue, 9 Nov 2021 03:29:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 563F0611BF for ; Tue, 9 Nov 2021 03:29:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238141AbhKIDcj (ORCPT ); Mon, 8 Nov 2021 22:32:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236843AbhKIDch (ORCPT ); Mon, 8 Nov 2021 22:32:37 -0500 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB9A0C061570; Mon, 8 Nov 2021 19:29:52 -0800 (PST) Received: by mail-pg1-x52f.google.com with SMTP id g184so17179888pgc.6; Mon, 08 Nov 2021 19:29:52 -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=bpTT21mAp4VSWsNSQkzhLDrxlsexFumDpJG1y4x7W3/zDCP5CgNXxJb/wPWEgEzly2 bV7DczaoqXHGw22Muw7cDZyWViC6ktvrTRwyoW+FFP2Fh4d0ITXk0KBedvaPg8/lq7dn 0gt+QZsCYdS3wBsN5O5olGyMEGvnQeZN2EeFeTvojnSj85bolAtWhhNwmRpHVc4mvW5L cSyFQXzujq3CS2vuG1bQQXwmB+F6l0h25JPptF1GiNQvqzhb50EApCVuE7mIzz+3xkX/ fdQBQfGY8svS0LkXqcH6eTUjGa0An7d7I2ddxlhVCX21R47trB8gQNB2RRM+Am2hXIZ/ Lmvg== X-Gm-Message-State: AOAM533kf54rROH6a4vT3Nco0JFKh2JRLh351YUv6HGbQd54izM4RMED vhkrSKUVM5MJfznJkf00qfPc09wmo78= 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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; -- 2.25.1 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 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: , 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 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; -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel