Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9087512pxu; Mon, 28 Dec 2020 06:19:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZW9AdY2eLaWg+h33V/n4WZ4ecCDVjaNfDKdU+d3KGKWOat4wOyVMZfPh473BnER9CTtMB X-Received: by 2002:a17:906:848:: with SMTP id f8mr41013971ejd.404.1609165182703; Mon, 28 Dec 2020 06:19:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609165182; cv=none; d=google.com; s=arc-20160816; b=bXjY3LEreLwa90du0u8hJINaGl+td6XTYIjHp0qE1U2rn/LCXdpsfmzu82lgbTxX3q ODJB2IU2pNOh9k2Fg3HUAkMwC6449fJcdgHyKeWx9eJUNX4Gbj+2maIPRLzGvgF4s5YZ VPbe1kve0yscJXKyS5qlSoiEuQ5L0dB3LfYmULy4i9CZhow1+a1+dyeDEPYAhHhM29OQ Xz7CfTyZaO3azKbV7ZcvmyxsGiwUTK9x9mhxIFkxt+widALOKwE9TlhnbCmoIcZuFP/L Oq/Mu57XAcnKPvGZz1StXrZwNjFREECONI2WvPrSDjzYOMRZ+bvI5HXMJTJI+5XNrNcf sg5w== 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=dtDDetpgpV7Ka3mS/fxB34LmwW2c4rdbiFVZmL3LZWE=; b=E8xuPF0DhdphBZZ06Zs/R1Px4sDWBYs0Xrut7Mn8hzzK4UTrv1KUcmLv4FCSPR7OC6 fDvGZ5tvVtgiMvCM+YZ46fiaKDm/ys5DVTsWf+KN6dNh7FtALxbZleyxc5c0Turiz26A TppSQHHanY9OhuvwhGi+teZ7tqEDL/RspXMFzBDzY7UzxyAuNqkfkFeKJW4cJyR2vbum idxijGtiquiwYw52GvKJH6Ne6LpObQOtJhWGST3gX1PiM7HM3kA7yhXZN5N3hsfUNlvs RnvLLpQCNtsSOXQiEPpMQq/bHd/Ln3/q9p8Y8FgcOArQ84rlr9m9a3eWTvo6qYa4l+Da B9qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=u3RANovK; 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 g1si12860799ejf.714.2020.12.28.06.19.20; Mon, 28 Dec 2020 06:19:42 -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=u3RANovK; 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 S2440598AbgL1OPk (ORCPT + 99 others); Mon, 28 Dec 2020 09:15:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:50570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440700AbgL1OPg (ORCPT ); Mon, 28 Dec 2020 09:15:36 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2BEB3205CB; Mon, 28 Dec 2020 14:14:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164895; bh=sWakMOXdwCC/ypmEv8UgTB3TrosXYNhtfgw1bY55Dms=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u3RANovK0sRnnJEAtYz7sLQ0NJH5bioyzrR7bgjzDNw4K1E2c3CZnmaTwCdh0Wo0v EqYh+MsM5bEnNP34c0QFo4EKhGSk3mTEyP7nCXDza3HT/60inbwthV3Gvy+03ycfsH S58jiX4xgZVr7j21uR1cuKs6OXr/qU4mPSm4dy7Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Zhang Changzhong , Serge Semin , Mark Brown , Sasha Levin Subject: [PATCH 5.10 337/717] spi: dw: Fix error return code in dw_spi_bt1_probe() Date: Mon, 28 Dec 2020 13:45:35 +0100 Message-Id: <20201228125037.167602366@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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: Zhang Changzhong [ Upstream commit e748edd9841306908b4e02dddd0afd1aa1f8b973 ] Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: abf00907538e ("spi: dw: Add Baikal-T1 SPI Controller glue driver") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong Acked-by: Serge Semin Link: https://lore.kernel.org/r/1607071357-33378-1-git-send-email-zhangchangzhong@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-dw-bt1.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-dw-bt1.c b/drivers/spi/spi-dw-bt1.c index f382dfad78421..c279b7891e3ac 100644 --- a/drivers/spi/spi-dw-bt1.c +++ b/drivers/spi/spi-dw-bt1.c @@ -280,8 +280,10 @@ static int dw_spi_bt1_probe(struct platform_device *pdev) dws->bus_num = pdev->id; dws->reg_io_width = 4; dws->max_freq = clk_get_rate(dwsbt1->clk); - if (!dws->max_freq) + if (!dws->max_freq) { + ret = -EINVAL; goto err_disable_clk; + } init_func = device_get_match_data(&pdev->dev); ret = init_func(pdev, dwsbt1); -- 2.27.0