Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4607630pxj; Wed, 12 May 2021 09:08:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxoyNui+uOIR9HAE+UNXZvs+pQWO1yvTcSbNMA81/dikBnpyxfeo+GUucb0cZnV0xYPKgR X-Received: by 2002:a2e:8686:: with SMTP id l6mr31057086lji.325.1620835728204; Wed, 12 May 2021 09:08:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620835728; cv=none; d=google.com; s=arc-20160816; b=Aj4LmQmiHaPjoKFXML3+LrCi4iAIX1RjNiZTYIB98uNvOCx91kOVcbVCXDkyh/wBvW fz7F6y0fiG8bImw/KskY1PFtYlpq/OuqLWrrpYJeBBKxXGUugn1K8u+3/KW+nizLymTk 4Mqs/CGEn6amCzgWFkrtb01//z0BJQqkwjfuHVtTOOh7l64k38kYTCTw+05zsScwWwtI nzrdkOkBbTQ0D8Ks1Vd7Vjjws7t+h0bbyxDA8r9eYbAybpSaE1SwRc1WWDoA5Lf9l6N6 tywee5A0YoxWk1oaSYIqulaU83bmBBg2VUarkZnVdn3vp3Dvn29l2eBRk/mhd+FsSby0 ZdAg== 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=nuuAbJNQwAsUsvHIXod0Iu4zcrYrqLWsQ78QjAXGkkI=; b=PagN0vBZ8kF74hNb0dZL3GdzwHmWL0/zS0DO5GVadjdax1i7ug2qZHmVcAWVoticDL 3qKTEtRfAjC+7RKSBqvmKbFqPN8SMo0B88H350HD3pDBnBKQcquzG5jVjy1FB5xu+O44 L0pQtqKmNJfpsFoWT5Bu/8vc+r6s9NQw20sE7Pfr4nG8XC8qaJmQrXeKbnb36163SQmx FG+M6p+2Yzjn2CndR2dKUThByUuxPe6pO9EMfJ8axeQjoWj9yllVNPAy/eAhPhvzFTVJ vhlpjQHxcAUqZhrv7bcLdLMy82rSqJFfukcMxUsUtM3GTc3fERYhEabz625qS40BKH14 FXZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=u1iIrGjo; 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 j7si144612lfb.367.2021.05.12.09.08.16; Wed, 12 May 2021 09:08:48 -0700 (PDT) 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=u1iIrGjo; 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 S238749AbhELQGO (ORCPT + 99 others); Wed, 12 May 2021 12:06:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:60640 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234262AbhELPY1 (ORCPT ); Wed, 12 May 2021 11:24:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C99DD619B8; Wed, 12 May 2021 15:09:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832200; bh=6lvHFHYMDNWaYkhtqQmaWo3FuG3KnZbcmDQJ0ec4z2Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u1iIrGjoDUkiVtcTHm1+axvOsW6LA9cojRMM8iiRL21T5VI9i72SV8eDUYXgNlAj2 UFOFlsHYgbQZR8ecr+XJaUENaNSGbcShJDL2o8hOKbC6vcXXXKS0Fc4kGVNmWg26kU yBu59oUsjOxgfg/xJNqh5It67eYtphykXKxKYpKw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Miquel Raynal , Sasha Levin Subject: [PATCH 5.10 148/530] mtd: rawnand: fsmc: Fix error code in fsmc_nand_probe() Date: Wed, 12 May 2021 16:44:18 +0200 Message-Id: <20210512144824.714663202@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@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: Dan Carpenter [ Upstream commit e7a97528e3c787802d8c643d6ab2f428511bb047 ] If dma_request_channel() fails then the probe fails and it should return a negative error code, but currently it returns success. fixes: 4774fb0a48aa ("mtd: nand/fsmc: Add DMA support") Signed-off-by: Dan Carpenter Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/YCqaOZ83OvPOzLwh@mwanda Signed-off-by: Sasha Levin --- drivers/mtd/nand/raw/fsmc_nand.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mtd/nand/raw/fsmc_nand.c b/drivers/mtd/nand/raw/fsmc_nand.c index c88421a1c078..ce05dd4088e9 100644 --- a/drivers/mtd/nand/raw/fsmc_nand.c +++ b/drivers/mtd/nand/raw/fsmc_nand.c @@ -1078,11 +1078,13 @@ static int __init fsmc_nand_probe(struct platform_device *pdev) host->read_dma_chan = dma_request_channel(mask, filter, NULL); if (!host->read_dma_chan) { dev_err(&pdev->dev, "Unable to get read dma channel\n"); + ret = -ENODEV; goto disable_clk; } host->write_dma_chan = dma_request_channel(mask, filter, NULL); if (!host->write_dma_chan) { dev_err(&pdev->dev, "Unable to get write dma channel\n"); + ret = -ENODEV; goto release_dma_read_chan; } } -- 2.30.2