Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp347275pxu; Thu, 7 Jan 2021 06:38:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwbeGsF7aAdQgc7EcRl5EfX/YDis2IBGNHjdHFLMQY2HQ9TB0wcgETw3w4uyKhPMQ98+gpK X-Received: by 2002:a05:6402:541:: with SMTP id i1mr1944519edx.289.1610030299237; Thu, 07 Jan 2021 06:38:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610030299; cv=none; d=google.com; s=arc-20160816; b=zW9yqEIhigo9PvDNW0qJOQ1UDrAl6mnV/b8iFejVhNXsC7GAIJiCowgxFmhtwtVVM2 fRvIvlVaimGagzjKRGfamh7i6PhlKUehKy7dKyv8d1dctIMh19OWpAzit+zcG8gegwdU qIAyOEYZCOF7xLvrdNRFbAz6f6PY8wNlaw1LG6EGK/lEqnCbo7MY94F59pG7jDjiKwaP hZB9D6tLEb1zAZNtwxHd5cGQ5kt4ZFBMsF1zTVV7ekFnrXVmbcTyYyWy7OBloTykJXQn VC0R03+CtSvcaD9cNKWB/bLrZk6zS4zJgFhmIFBVk6o309QhRUmC36zb7yV7j21KxK6k +C5w== 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=PnwTNcqOxqmtNIk1HsVAUowlKWP1ubazvSMFOFHHz20=; b=F/pXBtryFviCnLg0yKRm8Dtc49U5+A2l9WFDBImGDCUY0nmPJFLd3qjQ1hYayp2Hnx J6Nbu/bCn5thwNoC2U7wWlAg1ctuPAr/ph3zGHfV7v/kt4t/8YOW0p3bgcKpRKnaXFgt ihAU9hZR0Dsl8iY+UT4vuC3QbCN/gvIN5b7f+U4k9kb41BSDUJgm1u2uyuP1nkiLXzNa QtgswwaqBMA4azWKmaYVq8nftfOpH8t0oexy1tB1IHbZYEPS9zvzF9w22yKx2sUKKQJD Q1HCY87aiQezYyrjdwfcQMcmihULDFXwgK/WgGy8NYxiDTDOgfG1nClM8pwt2xGRumYX 8FtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BFVcGKNz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id co17si2310950edb.518.2021.01.07.06.37.55; Thu, 07 Jan 2021 06:38:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BFVcGKNz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728049AbhAGOdF (ORCPT + 99 others); Thu, 7 Jan 2021 09:33:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:47050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725960AbhAGOdD (ORCPT ); Thu, 7 Jan 2021 09:33:03 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A54B62333E; Thu, 7 Jan 2021 14:32:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610029943; bh=rL8SPjrjjedUT5cwUiy92UMYjYVpVsTctXFdFqbowhM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BFVcGKNzUt/0buB1Xjfxr8Vc9qLHoTN8qtdZ0wAmknCcE+tI7XPOILABcHumeFOog IkHtpYo4E9bOwwp71JvOPfmL5bC5qG98W0aaNOodwrHdQFg1W5MosYlgkUc34SwEp+ hEuKK8aCebG4THn1wW/Fy+nOdZ+8TPDvpiuOrfaQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yu Kuai , Vinod Koul Subject: [PATCH 5.4 04/13] dmaengine: at_hdmac: add missing put_device() call in at_dma_xlate() Date: Thu, 7 Jan 2021 15:33:23 +0100 Message-Id: <20210107143050.505932032@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210107143049.929352526@linuxfoundation.org> References: <20210107143049.929352526@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yu Kuai commit 3832b78b3ec2cf51e07102f9b4480e343459b20f upstream. If of_find_device_by_node() succeed, at_dma_xlate() doesn't have a corresponding put_device(). Thus add put_device() to fix the exception handling for this function implementation. Fixes: bbe89c8e3d59 ("at_hdmac: move to generic DMA binding") Signed-off-by: Yu Kuai Link: https://lore.kernel.org/r/20200817115728.1706719-3-yukuai3@huawei.com Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/at_hdmac.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -1674,8 +1674,10 @@ static struct dma_chan *at_dma_xlate(str dma_cap_set(DMA_SLAVE, mask); atslave = kmalloc(sizeof(*atslave), GFP_KERNEL); - if (!atslave) + if (!atslave) { + put_device(&dmac_pdev->dev); return NULL; + } atslave->cfg = ATC_DST_H2SEL_HW | ATC_SRC_H2SEL_HW; /* @@ -1704,8 +1706,10 @@ static struct dma_chan *at_dma_xlate(str atslave->dma_dev = &dmac_pdev->dev; chan = dma_request_channel(mask, at_dma_filter, atslave); - if (!chan) + if (!chan) { + put_device(&dmac_pdev->dev); return NULL; + } atchan = to_at_dma_chan(chan); atchan->per_if = dma_spec->args[0] & 0xff;