From patchwork Fri Jan 24 09:27:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 232992 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.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,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 B1994C2D0DB for ; Fri, 24 Jan 2020 11:16:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7E38820708 for ; Fri, 24 Jan 2020 11:16:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579864616; bh=rXkUQd+1JMRl8DPvb2RiWzCJ4fupfzrGRgRAtFXg/Y4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=GvpLxVCoSGhmI9hImMIZwmKE9LEFma/jWIUJgaJ48U7eZL2IHwM7VPLA8W2whjUAQ ehvMoySPL+0ean7RfBRwOo18fuTZbk5OsYeR/foMHbLYUTDs+M804h52Q6T+vmxRrP h9cVeT+BVpgsvI3r0+SPq0l56kmZZY/3Fm8+dZkw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390419AbgAXLQz (ORCPT ); Fri, 24 Jan 2020 06:16:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:53742 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390429AbgAXLQx (ORCPT ); Fri, 24 Jan 2020 06:16:53 -0500 Received: from localhost (ip-213-127-102-57.ip.prioritytelecom.net [213.127.102.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 83A2A20708; Fri, 24 Jan 2020 11:16:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579864613; bh=rXkUQd+1JMRl8DPvb2RiWzCJ4fupfzrGRgRAtFXg/Y4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k2YF/RXjH0Bl3KD1nBUdFbZDGe16xudoI//pP3SEOy3QyAyUvE0uoN3XE4/AsfkuG DTe0DljpvNJEAVZhiGxy774JohVJe0gWuhVck6W+4wXipo4G3iDCWRIl0HhQmDNJzc nVydi6jE4ZWYU4vjg5Edm1d9U/4V64NeHPva3Mxs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Steven Price , Sudeep Holla , Sasha Levin Subject: [PATCH 4.19 302/639] firmware: arm_scmi: fix of_node leak in scmi_mailbox_check Date: Fri, 24 Jan 2020 10:27:52 +0100 Message-Id: <20200124093124.784142120@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124093047.008739095@linuxfoundation.org> References: <20200124093047.008739095@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Steven Price [ Upstream commit fa7fe29a645b4da08efe8ff2392898b88f9ded9f ] of_parse_phandle_with_args() requires the caller to call of_node_put() on the returned args->np pointer. Otherwise the reference count will remain incremented. However, in this case, since we don't actually use the returned pointer, we can simply pass in NULL. Fixes: aa4f886f3893f ("firmware: arm_scmi: add basic driver infrastructure for SCMI") Signed-off-by: Steven Price Signed-off-by: Sudeep Holla Signed-off-by: Sasha Levin --- drivers/firmware/arm_scmi/driver.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index 09119e3f5c018..effc4c17e0fb9 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -662,9 +662,7 @@ static int scmi_xfer_info_init(struct scmi_info *sinfo) static int scmi_mailbox_check(struct device_node *np) { - struct of_phandle_args arg; - - return of_parse_phandle_with_args(np, "mboxes", "#mbox-cells", 0, &arg); + return of_parse_phandle_with_args(np, "mboxes", "#mbox-cells", 0, NULL); } static int scmi_mbox_free_channel(int id, void *p, void *data)