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=-9.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 1D048C73C53 for ; Tue, 9 Jul 2019 17:29:04 +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 E633720665 for ; Tue, 9 Jul 2019 17:29:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="iNikVts3"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GJl5bfEy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E633720665 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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:MIME-Version:Message-Id:Date:Subject: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=nG8BtTV6VIFXssvNhBGYOfKduXfPO036rKwHL6VzmOw=; b=iNikVts39BfkCN AE2rVlU660UXPEe7xX3h33Y5UJ/ZO8wt/szFBRUAopxemyu3b3bfDl4gyyf1G5KDXpeXZiPmrcCLk B6ZHzDFfMoGzW4dWle4nNeBmrsQa9IF3Kobu/hkrFlgoAPLiGEYgO6uHQdEyL6BMSQeB/4q3VzYZ2 mhS29PkZVMu80ynBklqaXT/sJXG2XODgIvFAYFgyiAhwv73JB4aO/l+z3Cwpc0nf6yg2KNY3pZ7Lb wBd+Cvx2ZAcJ7i2Izw0+jNWDid0yJrnEkDImC/n1x6kyUUtT+OyjlHrzlMP8oe6/8x9hl3Mcjhgiu UjWx949T8Zbj6yo/n5Jw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hktvF-0005H0-Lw; Tue, 09 Jul 2019 17:28:57 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hktvC-0005GE-AS for linux-arm-kernel@lists.infradead.org; Tue, 09 Jul 2019 17:28:55 +0000 Received: by mail-pf1-x441.google.com with SMTP id u14so8442471pfn.2 for ; Tue, 09 Jul 2019 10:28:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bzkKqUk15jLQrEfYInm22zoAV7LnCW6U344yV071lSE=; b=GJl5bfEy9e9YnFoBVdvkrsSluu4briySpv38RvlBMBknz3J8vxF0HR62lpTbtp9+Z/ X4jgJxgT5T+QEBjAe+yeZQNs+Igd53Wz6Hdx144cQmhpP0h96WMChKulYZ6NwaXAJCH1 2N4dvbJNEvcyVn4Omn0Kpie/ylsm+58vb8/0A3XxtOdHuXAUKjJ9TkrDt+6aRW/AgBqg HgT4fZOR2ZhwBaS9IclYx4XBz96jua4Yzrvd8Ee0S7VxoFO23M6xGgAfnn+eBU1zmfbW 6TcZkWMfXMV5WIq4aW1CdNd3483wXMXcq0PWFUaYlgDYcUwCw7+q1F7w/+uqhVICKNRd xlsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bzkKqUk15jLQrEfYInm22zoAV7LnCW6U344yV071lSE=; b=Uq1IWHHxI+jWbO8MLbVShO/bbOJhUOH7lPU9rw8OmbMBHt8saluZZ9bAn9Rw9i5uv0 KX35XbiVYhTD2AgRcoWqfDB5b7YN3RDM3M5SsbsN/7Ke93P/W2Dz6bXjF28PF1GS9wHy qRqEH82J5eAzlxfwxd1IpVwv1+ToSPGS9dmlAqVetxbC0Gq2mwKknwxcjox0LnPoUYb9 YSlMS6kJ8XbscEZo7Vy5bT8X90FkLAIdhTfzFsUHLqQD1KYz7u/hffJvc4LnEjs2FkqQ /kEWCdBspn+dt7B8iPir6NLpIC4bx09X0f5SeV54Yx6L0NybSgd6qcg7oA67COjzssla tkGA== X-Gm-Message-State: APjAAAVU1hQqr42tGVsM9QzSbahPbphpqJMxCosi9oQF90u2dIz9nkbu 7TDI+TAJWtaLWAIVhaas1VM= X-Google-Smtp-Source: APXvYqzbDrWUOoVaB4ZOiaFytDycmlBjlrY5pweLXs0yXvcAr2UGniO6mqF2mEeEyzv54uIn1C1mKg== X-Received: by 2002:a17:90a:a489:: with SMTP id z9mr1364690pjp.24.1562693333402; Tue, 09 Jul 2019 10:28:53 -0700 (PDT) Received: from localhost.localdomain ([110.227.64.207]) by smtp.gmail.com with ESMTPSA id t2sm18788461pgo.61.2019.07.09.10.28.50 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 09 Jul 2019 10:28:52 -0700 (PDT) From: Nishka Dasgupta To: jassisinghbrar@gmail.com, michal.simek@xilinx.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] mailbox: zynqmp-ipi-mailbox: Add of_node_put() before goto Date: Tue, 9 Jul 2019 22:58:41 +0530 Message-Id: <20190709172841.13769-1-nishkadg.linux@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190709_102854_365685_DBB3DB97 X-CRM114-Status: GOOD ( 10.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nishka Dasgupta 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 Each iteration of for_each_available_child_of_node puts the previous node, but in the case of a goto from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the goto. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/mailbox/zynqmp-ipi-mailbox.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mailbox/zynqmp-ipi-mailbox.c b/drivers/mailbox/zynqmp-ipi-mailbox.c index 86887c9a349a..bd80d4c10ec2 100644 --- a/drivers/mailbox/zynqmp-ipi-mailbox.c +++ b/drivers/mailbox/zynqmp-ipi-mailbox.c @@ -661,6 +661,7 @@ static int zynqmp_ipi_probe(struct platform_device *pdev) if (ret) { dev_err(dev, "failed to probe subdev.\n"); ret = -EINVAL; + of_node_put(nc); goto free_mbox_dev; } mbox++; -- 2.19.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel