Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3928436pxj; Mon, 21 Jun 2021 09:34:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAQw8hyoqoP3drHEtioggjdcT8mwmU7aD35gQnExWN2tARunKeJrHdLiZijJfD34E9tIFd X-Received: by 2002:a05:6e02:1b84:: with SMTP id h4mr18300011ili.7.1624293241094; Mon, 21 Jun 2021 09:34:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624293241; cv=none; d=google.com; s=arc-20160816; b=f4H6uD0zZvOCozIeMRc/B/OD6DKhSc89mffDchmGqXIxBG/Y3rcMMF2ZhJaCsB68Qr k54qgp+KjoFAxSNPZfDEGSbafTrdR0o69w7V7ps9inxiatGMma/zGkqJzxJJKaF6zXfe hODfPlPDswG8nPRF1QjRJtBHEQ98lhxk3yMLlwtVAJ9IcCSA77HJc9eyQNf/JGiN3y+w Ha19OLRC/s/NRpX1HWmeDRkCUsglf0t9lhP/WXzYsNsAjNsfMGcjTFsBDucNj2l6ZtPv J3xr1VEgzhu3VfMWzHB3tns542jPkoVrzCPh3gwxK0kYbIKUK1gFfECiRpbGGdkfLX3j DvmA== 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=nj8w2fB5yi3JJgrxK8Um6xG2hoC1KwSuoFen1dmG0nepGSuomNNyxS6jNFX2iRLwWf XQgrhJ+zi/vpTQssqipY6fOL9/F8BHefBUZbf1u7AYafi+LBnoDMcSF565vjuwm2JZsD fl7uAnfERhMhHYEI9RdIkY/e2kpcNIc5BQ4lQ3+l7Sf4cOq5xWTvNpcU8xm8zBLSDrzJ rhNukZXTVIPNyeUUP79U5QkJcNDTGfFmda4UfFOBmWIwfJfmcABUjoxdO0rAbL5JTaUT UHfVI/tbiuU8SoCeT0w3ieij8zaj9CJKbdl5CT//WmLOUJUtw/XHOuKI9/31JIotth1A Ckhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=k7X3KUv3; 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 i9si12471500ila.58.2021.06.21.09.33.49; Mon, 21 Jun 2021 09:34:01 -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=k7X3KUv3; 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 S232480AbhFUQfa (ORCPT + 99 others); Mon, 21 Jun 2021 12:35:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:49592 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232344AbhFUQbN (ORCPT ); Mon, 21 Jun 2021 12:31:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 43ECE613C1; Mon, 21 Jun 2021 16:25:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624292732; bh=nGOf27RMGsJa6chr7glk2gXKh75BH+v6kU7jTmObYQA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k7X3KUv3RbclgJeB642aamcAOmxBfKKpYczSTXUU93ETByk7mkZJCkhwvfpQ5qSj+ y/v5IT/+lQfDd5xuhiamEfepT2jdJbT3gHrqpNDefSukT2aohTZgzwcjZzdnvqdv1W C5CZu+yJvNWGl6uIAourv3sZYt0H2vSFifFqtkc0= 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.10 082/146] spi: spi-zynq-qspi: Fix some wrong goto jumps & missing error code Date: Mon, 21 Jun 2021 18:15:12 +0200 Message-Id: <20210621154916.222232038@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154911.244649123@linuxfoundation.org> References: <20210621154911.244649123@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