Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3156954imw; Mon, 11 Jul 2022 03:08:27 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vSwHMz+Qcd549SlkBFnIRwQ8lGDCuCLRl1xYbzFkWHFGUOB6y6iTPY1TyJaAlVkQordVNT X-Received: by 2002:a17:902:ea0f:b0:16c:134:a247 with SMTP id s15-20020a170902ea0f00b0016c0134a247mr17496453plg.86.1657534106947; Mon, 11 Jul 2022 03:08:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657534106; cv=none; d=google.com; s=arc-20160816; b=vAsOTJO4TQoOY4jqhAt21pBkA1kk/S3qi94mkw2kEP7w9R0FJPCGhmBeCcQRgj5Uip n6o9DhdBOpjjHsqvf/qk/j4qgHL0gyBuZ8PmsPDs0VM4mQ2xzB1kPjYJg/tZtFNMznHH HDTKgR+xI9ubT3Z1bK8z02LSetu7yWJZr02cT9bstezUmZfgd3gzJoOLi0rnuvpYyIT8 t4c5CQbdDEHKcmv2GwhyWQT2BF3+szSTUuPkxuvUGZ418FU7iVZ51Xwru4+YPhvqK/SV MYVZO7/lS3sx64qAmuYSrMgYzdQxvMbcPeaZjSK4An8JYFUZXd404UkSldw6EavCkVql AirQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IzPunpTLKiILbLXCSvBRjfR8ht0ejWucu5OkS6Oh3l8=; b=ltU5NU92qo2erc7KkBdOwTHCzBjl8oDtWK4Ku4pFQtGDr8r1EDueINcRufPWe2qqE8 Yj/YmNjOJ6PqDRcejVtQaQ6s+RUoxRB81f16GqH5fNRdtbSeRD53Ah3EojjJ9V5B8E1A H+FwgDHaw3RUA6OceY6W1/XglEEzDpzK6WLBoigNmvWU6a5cjBvjVReU6kr3QuW+sbNk qTFcWYNm0vYAePgAR1qqVRx3M3/zIH4Z3QxNUNZa9pIcEzj5JIGs/rFSNV9AJOpn1KyS CJoht24GPadgZ5ZYUnsto0PZIQdhSLfHe+0tXwS7IuGM2lcX11LUrpUlk4qGoWsNCTUJ rgVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jw0oS8WU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m16-20020a170902f65000b0016bfa1368dcsi9454944plg.236.2022.07.11.03.08.08; Mon, 11 Jul 2022 03:08:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jw0oS8WU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231436AbiGKJNO (ORCPT + 99 others); Mon, 11 Jul 2022 05:13:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231373AbiGKJMo (ORCPT ); Mon, 11 Jul 2022 05:12:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20F472C11F; Mon, 11 Jul 2022 02:09:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2A008611CD; Mon, 11 Jul 2022 09:09:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37ADAC34115; Mon, 11 Jul 2022 09:09:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530566; bh=Pzmd/zN1nIln9o0WDMVsAXhhz3zAUCufCzsOSJga0K8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jw0oS8WU511GRW3LlC++u8fWHpKeOAypOnAM8WphvwIrfDYQ+ajSVg/oyI+kmbtf2 sQs87o9wlaGTVaVYRfh+k28ACK7CQuSyBX4ly4CT3b7jfTKKcmjiZFSUDBx6CiPo/+ L8uxPRRnxYl1q2FCbQ3y6yxcQmVfNUbLmj8Z8YMQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Peter Ujfalusi , Vinod Koul Subject: [PATCH 4.19 31/31] dmaengine: ti: Add missing put_device in ti_dra7_xbar_route_allocate Date: Mon, 11 Jul 2022 11:07:10 +0200 Message-Id: <20220711090538.765377355@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090537.841305347@linuxfoundation.org> References: <20220711090537.841305347@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miaoqian Lin commit 615a4bfc426e11dba05c2cf343f9ac752fb381d2 upstream. of_find_device_by_node() takes reference, we should use put_device() to release it when not need anymore. Fixes: a074ae38f859 ("dmaengine: Add driver for TI DMA crossbar on DRA7x") Signed-off-by: Miaoqian Lin Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20220605042723.17668-1-linmq006@gmail.com Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/ti/dma-crossbar.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/dma/ti/dma-crossbar.c +++ b/drivers/dma/ti/dma-crossbar.c @@ -251,6 +251,7 @@ static void *ti_dra7_xbar_route_allocate if (dma_spec->args[0] >= xbar->xbar_requests) { dev_err(&pdev->dev, "Invalid XBAR request number: %d\n", dma_spec->args[0]); + put_device(&pdev->dev); return ERR_PTR(-EINVAL); } @@ -258,12 +259,14 @@ static void *ti_dra7_xbar_route_allocate dma_spec->np = of_parse_phandle(ofdma->of_node, "dma-masters", 0); if (!dma_spec->np) { dev_err(&pdev->dev, "Can't get DMA master\n"); + put_device(&pdev->dev); return ERR_PTR(-EINVAL); } map = kzalloc(sizeof(*map), GFP_KERNEL); if (!map) { of_node_put(dma_spec->np); + put_device(&pdev->dev); return ERR_PTR(-ENOMEM); } @@ -275,6 +278,7 @@ static void *ti_dra7_xbar_route_allocate dev_err(&pdev->dev, "Run out of free DMA requests\n"); kfree(map); of_node_put(dma_spec->np); + put_device(&pdev->dev); return ERR_PTR(-ENOMEM); } set_bit(map->xbar_out, xbar->dma_inuse);