Message ID | 20200817115728.1706719-2-yukuai3@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=RKuL=B3=lists.infradead.org=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@kernel.org> Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 64B57138C for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 17 Aug 2020 11:59:18 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3C1BB204EA for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 17 Aug 2020 11:59:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Pky7Y3ny" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3C1BB204EA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/hm3GdAfQdtfMC7+4u+KwOaFIuBbWgjpcgH53wQ5Eb8=; b=Pky7Y3nytRqhQ8wyaaae79vjJ V/bYNQ3zcnpCTBdX6NOdtxZKvOvygd9sfbD9BwmAuRqX4ciQMHvH/XdpYmBEIToY4YoSIINFScK9j DU0qA5oifxwI74/bkGDtlzLlvxWjMb74LQlI3ARlhAapEB/OM73L2A5H0tfa/cJ1d6e5p5ZWs+yrj CRktj/guepwd+qh4PTfyq7pyFuDvEl6Bs0vpZZcsoyo9qP0plX5zKCfKKbJ5iTbFaVppX8WUjgSGV xIQb0HZxcAs+60tqOmxJvGeVTia01ZCOx3ryGJd5X6qU+aLYAY6zACTXGiFRmYfjW/nz+eHFHYsQ2 i+7mHXzgw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k7dlw-0008MS-Mr; Mon, 17 Aug 2020 11:57:52 +0000 Received: from szxga06-in.huawei.com ([45.249.212.32] helo=huawei.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k7dlt-0008LL-OT for linux-arm-kernel@lists.infradead.org; Mon, 17 Aug 2020 11:57:50 +0000 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 2189CAE7D8B1F88B5A92; Mon, 17 Aug 2020 19:57:44 +0800 (CST) Received: from huawei.com (10.175.127.227) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Mon, 17 Aug 2020 19:57:38 +0800 From: Yu Kuai <yukuai3@huawei.com> To: <ludovic.desroches@microchip.com>, <tudor.ambarus@microchip.com>, <vkoul@kernel.org>, <dan.j.williams@intel.com>, <nicolas.ferre@microchip.com>, <plagnioj@jcrosoft.com>, <arnd@arndb.de> Subject: [PATCH 1/3] dmaengine: at_hdmac: check return value of of_find_device_by_node() in at_dma_xlate() Date: Mon, 17 Aug 2020 19:57:26 +0800 Message-ID: <20200817115728.1706719-2-yukuai3@huawei.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200817115728.1706719-1-yukuai3@huawei.com> References: <20200817115728.1706719-1-yukuai3@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.127.227] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200817_075750_072585_A4B80F78 X-CRM114-Status: UNSURE ( 9.21 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [45.249.212.32 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [45.249.212.32 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: dmaengine@vger.kernel.org, yukuai3@huawei.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, yi.zhang@huawei.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org |
Series |
do exception handling appropriately in at_dma_xlate()
|
expand
|
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 45bbcd6146fd..1c941f839c42 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -1650,6 +1650,8 @@ static struct dma_chan *at_dma_xlate(struct of_phandle_args *dma_spec, return NULL; dmac_pdev = of_find_device_by_node(dma_spec->np); + if (!dmac_pdev) + return NULL; dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask);
The reurn value of of_find_device_by_node() is not checked, thus null pointer dereference will be triggered if of_find_device_by_node() failed. Fixes: bbe89c8e3d59 ("at_hdmac: move to generic DMA binding") Signed-off-by: Yu Kuai <yukuai3@huawei.com> --- drivers/dma/at_hdmac.c | 2 ++ 1 file changed, 2 insertions(+)