Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp685771ybv; Thu, 13 Feb 2020 07:45:21 -0800 (PST) X-Google-Smtp-Source: APXvYqz9+lnJbUPfAAhf1ZBWF+2FS5a2E9BOb2gv9zSg/eq7bfguiIi71yJ1NZdyogX8T1y3+bH7 X-Received: by 2002:aca:f517:: with SMTP id t23mr3205155oih.160.1581608721423; Thu, 13 Feb 2020 07:45:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581608721; cv=none; d=google.com; s=arc-20160816; b=zPvS6fFu663ntVmP+vmaN9e5aQmvpMExgPna0AK+v37Sh0LABvx1DPkBdz/Tzgd0VU bKrN2IEfjv0chwZb7RAFeWz1e2cgD6yEGypmKpuLesp/yyww+KP8e8ba0awPteCL/SfB YIiZjXUbQ/8h3+Gcx6spMfN+zvG+pWMB/Aj7blvCbAg2DSbOa6hmg3nc6Bgc1eNR4Xuk t7X795Y/lTztZuZPWl3RXGFWMlAhH6PPOo96KWD06VMrv8nbtWjmv4Jid+I3isKvBcNe hiGuO8MBWKaGspr4pPY8B9e3nw3+GyepNJRPUWD3Nu6/dWHz3v/c7nN1MWTJXu6zbnH0 R74Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5xtsS41IOFreC7pPlPHlBonevf+og4Gmi3UAsPINSLo=; b=Poqp9i0/euCVRN0lBcVjLUbNicuC/UGa2vHekV9j0DenvjvesMEPucjKEiL3qiGLS+ esHl63cTiUw2wJQ4WAi2ylgN08wkRWZ/pUeF1UiLCSKgyb5jKlOCjl9P0McfEycn+C9O T5cx0ClhmtdrvdGT+W8JJpLoaGnsM0ll0UEPz087gegnkNqfaPuf9iWSYeflzgYaHWR5 ljNaKT+c3EwjumJdWu4wqow5HXR5UV7oJRrLlpsqvDlwDTnvAEb5jy/BM4mfYFX4woFs D/P+spJpCVRJshb7j05yk/tzl4z6T8zmgL6YCTStOK9bZtDw3Yb8AGuYKo23bJviGq4n IO6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="gnPdq/eb"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n14si1273324otk.179.2020.02.13.07.45.07; Thu, 13 Feb 2020 07:45:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="gnPdq/eb"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729540AbgBMPnv (ORCPT + 99 others); Thu, 13 Feb 2020 10:43:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:52832 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387464AbgBMP1t (ORCPT ); Thu, 13 Feb 2020 10:27:49 -0500 Received: from localhost (unknown [104.132.1.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6404620661; Thu, 13 Feb 2020 15:27:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581607669; bh=2LOS4tbupeTSygClD40dSb6uvh6u9TGMj8TmfoR5iNU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gnPdq/eb82pZywKR0VZg3Xs+jcY+f+h6MBkc1IAPP1So3Az826t0gsz9gdOPDJ5TI G3A3d662zdtFutLZkxRkb/1DM/COeT0PsSy1B4ihammN6c+OSWMYiZKYuumiGLrj37 UnankVi2Q57o/56DpeeCXZI/zm/Iw/DuuWMf3vAc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chuhong Yuan , Alexandru Ardelean , Vinod Koul Subject: [PATCH 5.4 92/96] dmaengine: axi-dmac: add a check for devm_regmap_init_mmio Date: Thu, 13 Feb 2020 07:21:39 -0800 Message-Id: <20200213151913.393408150@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200213151839.156309910@linuxfoundation.org> References: <20200213151839.156309910@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chuhong Yuan commit a5b982af953bcc838cd198b0434834cc1dff14ec upstream. The driver misses checking the result of devm_regmap_init_mmio(). Add a check to fix it. Fixes: fc15be39a827 ("dmaengine: axi-dmac: add regmap support") Signed-off-by: Chuhong Yuan Reviewed-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20191209085711.16001-1-hslester96@gmail.com Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/dma-axi-dmac.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) --- a/drivers/dma/dma-axi-dmac.c +++ b/drivers/dma/dma-axi-dmac.c @@ -830,6 +830,7 @@ static int axi_dmac_probe(struct platfor struct dma_device *dma_dev; struct axi_dmac *dmac; struct resource *res; + struct regmap *regmap; int ret; dmac = devm_kzalloc(&pdev->dev, sizeof(*dmac), GFP_KERNEL); @@ -921,10 +922,17 @@ static int axi_dmac_probe(struct platfor platform_set_drvdata(pdev, dmac); - devm_regmap_init_mmio(&pdev->dev, dmac->base, &axi_dmac_regmap_config); + regmap = devm_regmap_init_mmio(&pdev->dev, dmac->base, + &axi_dmac_regmap_config); + if (IS_ERR(regmap)) { + ret = PTR_ERR(regmap); + goto err_free_irq; + } return 0; +err_free_irq: + free_irq(dmac->irq, dmac); err_unregister_of: of_dma_controller_free(pdev->dev.of_node); err_unregister_device: