Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3940106pxj; Mon, 21 Jun 2021 09:49:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoqCCPv6IqSLGckRKRv8YoeqOKy5Jwji1+miliP4vyNBW05ytCy8FVZh1tGvV2OxJG9uzf X-Received: by 2002:a05:6e02:219d:: with SMTP id j29mr18776433ila.64.1624294149150; Mon, 21 Jun 2021 09:49:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624294149; cv=none; d=google.com; s=arc-20160816; b=za3ooiWYnaJiCMmreCXCmSHzjZqh4HgquC+m8VRE7J/CCpPJiwjlmgLprZzV+mUl0k Aykvk6e2K42Hx0C1bT4p0RyECHARDXlWvmmuWo/TXIDaX8LAjI17E+HmOHLNAtip3RYm Yc/SBA+orWZjti9qGxu8HgZ9/8uTjAqqbX3dTL3AQo1iX80Jh76ZB9djZSWeQpyO7nvJ eKSCN6+OLQcsFzCJs4AH80cCWA6dMYE/YYr4mRVUUjGGBWe8BI0JwFZEhAeAh/4AJ9YR HjZolfgQxvqGYUCVAT3C/rTIthRH0c5Gi+5i1tEW8kFaSRrVfgtlPNf9ijDO3JF113zP NOxQ== 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=IAtxEGIclqr4KsczOCeyZkfmltlWXVoshZTN9TxoKqI=; b=T2OPZA3CjOewtIaiulrYQuboJzZK6DG5YcydmvsRzPzkxn17GvSZM41iWYC4LdfdHs ZcRWboDaZ+s9I3Ke+qwxL5m3EzxdGfYDzr6LeRu9Ecq0LFuCJqpCxAJ/xxlgv8+Uc8Ce mQhqXQNUF8kEFUYyfWMG/2zkk0K3LV3WRNOSyvtSPbRhqylc2khHKApmVsJZX/L57Eru NykUezJGLVqEst588KwHjAT0Ou/CDpfwjggfLtjuTz05NxMSjz5eGIJ3xKV3zYBJCYD2 OQgFp/Zf4Y+OgBBz3fQValp8ehSjinOSQrTIlyO/qiVkb53KacUhF20rFxMVzFHmLl8i uaAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=x0o0bigu; 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 p14si21735908iov.42.2021.06.21.09.48.57; Mon, 21 Jun 2021 09:49:09 -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=x0o0bigu; 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 S233705AbhFUQuN (ORCPT + 99 others); Mon, 21 Jun 2021 12:50:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:37576 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234037AbhFUQqA (ORCPT ); Mon, 21 Jun 2021 12:46:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 735A4613B1; Mon, 21 Jun 2021 16:33:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624293187; bh=nGOf27RMGsJa6chr7glk2gXKh75BH+v6kU7jTmObYQA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x0o0bigu5dRQc5gUplb4MtOo9M8eqp4n9eMDy2V7OXPw4wDSShiesSbCU5KGKhv6X ct8I+S1a/3a+WF1ZmySxkeXhyphaW+ldpkD226l30skXr6a5EmGs5xIh2K45iFpi/v 35q4pZjE8c8NCnOIBVCM48Qrg/HBUJElzRqfGPpo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, zpershuai , Mark Brown , Sasha Levin Subject: [PATCH 5.12 097/178] spi: spi-zynq-qspi: Fix some wrong goto jumps & missing error code Date: Mon, 21 Jun 2021 18:15:11 +0200 Message-Id: <20210621154926.058249344@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154921.212599475@linuxfoundation.org> References: <20210621154921.212599475@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: zpershuai [ Upstream commit f131767eefc47de2f8afb7950cdea78397997d66 ] In zynq_qspi_probe function, when enable the device clock is done, the return of all the functions should goto the clk_dis_all label. If num_cs is not right then this should return a negative error code but currently it returns success. Signed-off-by: zpershuai Link: https://lore.kernel.org/r/1622110857-21812-1-git-send-email-zpershuai@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-zynq-qspi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-zynq-qspi.c b/drivers/spi/spi-zynq-qspi.c index 2765289028fa..68193db8b2e3 100644 --- a/drivers/spi/spi-zynq-qspi.c +++ b/drivers/spi/spi-zynq-qspi.c @@ -678,14 +678,14 @@ static int zynq_qspi_probe(struct platform_device *pdev) xqspi->irq = platform_get_irq(pdev, 0); if (xqspi->irq <= 0) { ret = -ENXIO; - goto remove_master; + goto clk_dis_all; } ret = devm_request_irq(&pdev->dev, xqspi->irq, zynq_qspi_irq, 0, pdev->name, xqspi); if (ret != 0) { ret = -ENXIO; dev_err(&pdev->dev, "request_irq failed\n"); - goto remove_master; + goto clk_dis_all; } ret = of_property_read_u32(np, "num-cs", @@ -693,8 +693,9 @@ static int zynq_qspi_probe(struct platform_device *pdev) if (ret < 0) { ctlr->num_chipselect = 1; } else if (num_cs > ZYNQ_QSPI_MAX_NUM_CS) { + ret = -EINVAL; dev_err(&pdev->dev, "only 2 chip selects are available\n"); - goto remove_master; + goto clk_dis_all; } else { ctlr->num_chipselect = num_cs; } -- 2.30.2