Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3121211imw; Mon, 11 Jul 2022 02:11:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1skzfxJgxHodaI3w9pSi7zalmbLWyf6ehLUcVH5P0D4NI4z2vGxawGAqvXUWgRHK3C6U44P X-Received: by 2002:a17:906:6146:b0:722:f8c4:ec9b with SMTP id p6-20020a170906614600b00722f8c4ec9bmr18194470ejl.708.1657530711589; Mon, 11 Jul 2022 02:11:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657530711; cv=none; d=google.com; s=arc-20160816; b=fCncqv1Bad3FLke5axpTgnA4YEqcR75UgsZemtWZLvs6SOjW9T2JEFFCUPar1ujeRp SPw3afBokMSw7cMQeIt02o0EA/Sf0X5HTTQ81nNEIFna5FuOa9Xt4SrXC+ju7SgB6Jdf 5QsTBlC4DDrWjyrZ0TlK1v9RdcDLuwHggV8gigLl94jt4kNO0nEpoFUXD6qxYLYKUKvr uyUCDiCEkcvcquLs/Jcz8NgibddG+ZtdQ4la0gA4m0FoLMd0bpNXXWs8b3to4s1YwH2C s6Inw2EoGqCEu+QWd/w0bpbE8JgKVuxSJ4tHuuU14NuN7Zajtx5azmQrwNpFp7avLbyg p7jQ== 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=TgbVd9+etmmqMHBsjU2IG+ns1IufxIu0XJagDql8XEc=; b=Usw0kiryPZ0U2juPkkMidWBHJcbc8o6dOoxEg3oIfzu4MBSqov7H1oln/nq4Ju2cXF Kw2Y8dGA1YA/d13cq/CzalkL+2ohTN6lyFxoEtPt1nNIMRdFjltuMn3orhSfxctVRBqV 71cKrgd1uwOgxvuDzsTAIycnmRmo30RSgZ59vNQvMzdh708K+v7XBvPOZOsX03M2gccU TnvVLaNr04c9RqQKY6PJ36DXrHOYngAAb8FY9k1CtNQC5qsdGt221SJct47wTYPxLk7t s9vnjWEpslJI57PySz3JB4aNAjYXiAXUUV+USRSFxKZsDSWZaTRHJZpLrcsOHy3AtgQL 44aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vkJmxqYP; 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 gb10-20020a170907960a00b0072b4a1b5519si6936921ejc.68.2022.07.11.02.11.24; Mon, 11 Jul 2022 02:11:51 -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=vkJmxqYP; 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 S229594AbiGKJIO (ORCPT + 99 others); Mon, 11 Jul 2022 05:08:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231216AbiGKJHk (ORCPT ); Mon, 11 Jul 2022 05:07:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9267522BD2; Mon, 11 Jul 2022 02:07: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 88C956118B; Mon, 11 Jul 2022 09:07:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9051EC341D1; Mon, 11 Jul 2022 09:07:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530446; bh=eAlf2ThEJ0oh3s9MfqamQLqIhi0NIAtmAN9WqohRE7s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vkJmxqYPT8OURuzDPSXUnQCO/04vqwH58wQH1uzOyHzzB2S3vxR9pScY8fBBCLJig WwIhCeG93d5RwdvE+T9EEhjAeOflF5uFdGnYZU3Cf1nJ0fdv/OhP5y2f+lTT+FNuWn 37fmVB7ienKJlf1CuiKlzJaIxKCYkh17JnuqPs6w= 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.9 14/14] dmaengine: ti: Add missing put_device in ti_dra7_xbar_route_allocate Date: Mon, 11 Jul 2022 11:06:33 +0200 Message-Id: <20220711090535.943227980@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090535.517697227@linuxfoundation.org> References: <20220711090535.517697227@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);