Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp344877pxu; Thu, 7 Jan 2021 06:35:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxIGDmLSzP+oPhs60FphPRDwO30J28V5HKPN7R8Blx4C1EyczalFTxKL8rsSA4I3r5nHKqt X-Received: by 2002:a17:906:52c1:: with SMTP id w1mr6749835ejn.214.1610030118150; Thu, 07 Jan 2021 06:35:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610030118; cv=none; d=google.com; s=arc-20160816; b=n7bZYGPnwgJoWhHstyQe0VQOp9RscK50g3ESALisv581cKJAP4SiWMFwUR3e+XPQZK RhpjgtVxEuH60dnQ+8jxXS+oTSEMH6glVhfJY/eSKwmnBqJ3PXRQSShl4cEqULdosD2U 0hnnAtRCYkK5LBLTSl13P+jt9NkZTi4daAeqhcpf9O6ezCG/+VtBnBFTsdC3q4GTfcOr YDGHkzJi48xcLuSCve8ppXMCAziWs2QdEWxJuSIFXidY0nSCvF8VVoev6doHPg3pzhFb wZo44KOxOu/ulRlfPunasJC8CkAG0IRudCRq55dxc8WcQQyiK2RFkIOx0nGWZXHsE6+V cUTQ== 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=KP1dNwDVwBLyqlOEqQNEi12imlASlNl/mxXq8IPNSVo=; b=D8xkNsTfRK99oDDC1TpIa4/Ztht+bsuwRua4tIF4WlEs4uIXrVH1SgP9jaui3vA7zd GwTz+jxKjHuJWXp9H/58hZg4UrEU/QLMuxMVYk8hPcv2ubM5sZPWC02ZoukJgCiWgsiQ vBqtsKOBqADz18ocRi4MJS7TwZ6DkFnc4qnimt4R/taZmvBqsA4fVzX6zaYTF0W/6Kli plK3lD2n8SQFZTcdjFkt/n9nYHCIrD+cpw7EvVFY2k3bQ+9Y+XBQt5g8rLIfU+BAnR2R ifPTTKCVVYb7/kk2i2LUEmz2ym/PDEbP7gOXCgG8BI1/RymIlT4v06PgsoNLGIYujl4C /m0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WNvZUaPL; 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 v17si2365359edr.428.2021.01.07.06.34.54; Thu, 07 Jan 2021 06:35:18 -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=WNvZUaPL; 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 S1729324AbhAGOcZ (ORCPT + 99 others); Thu, 7 Jan 2021 09:32:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:45832 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729279AbhAGOcS (ORCPT ); Thu, 7 Jan 2021 09:32:18 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id AC21F2336D; Thu, 7 Jan 2021 14:31:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610029916; bh=ej44jCxgDX+vbHLUV3UbuB+X4ZwVfwGfzDKw4seP660=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WNvZUaPLkerHEX3DwpyVci+ptQaMK2PbBRJGMcR1fmf8yKRC+ytdpxWnp0gaiN/Vr hEHZmsYM6MdWvaX9VnG1LF+cXnzSRaFkFgCwS/yxzxgR4+vvPexgGiNTa7Cmk8/qUi BXHtH/PskdES2vM9E2LZJH6g21hqnDn1zpbW885c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yu Kuai , Vinod Koul Subject: [PATCH 4.19 3/8] dmaengine: at_hdmac: add missing put_device() call in at_dma_xlate() Date: Thu, 7 Jan 2021 15:32:03 +0100 Message-Id: <20210107143048.026966771@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210107143047.586006010@linuxfoundation.org> References: <20210107143047.586006010@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 @@ -1684,8 +1684,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; /* @@ -1714,8 +1716,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;