From patchwork Mon Jul 19 14:53:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 479993 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4268442jao; Mon, 19 Jul 2021 09:08:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmiU4fLWW9i/OHrnbyp44iHizERNeAyA2AG6NSsHBPcwcCQc2//HYnsmCjnQJSRfg9bdWS X-Received: by 2002:a17:907:b0d:: with SMTP id h13mr28231823ejl.279.1626710939618; Mon, 19 Jul 2021 09:08:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626710939; cv=none; d=google.com; s=arc-20160816; b=uKlkreHOryC+GefDNGvtTXZKueKQbLHzJZu+nikRrP2r17HT+lf+YuISXz97sId7Lq hh4XxIjCUhYZflTRtfFuXz6FDeNqd7AgSZ0hjiiUDV/JGlJ24P6PK2fuG1C5oKChtgK5 WV8mw3pVIhM0QSfnMnC9hs/SlAOYj2Z2WC56zDhBkAKp+RDqU2U6LN0oYvhtpcTWmkE9 0SCdAY/urXa/nphRxnjCZBRR+yHj1uRoLEoRgLTecGMd4VnmJtU9+UEBn6+7Ac6Kja84 TMIFfQbtKbAXzi2ud9401myiqz8Pu5ZJuWbbZ+6lM2LO6BRS351MojdTm6KjBlQvcZWt KQ1w== 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=OLq6Xt4UqB66qfR6lP08cpfSLOsVJTCzl+Hkx+bRzOc=; b=uW5sYXNVHRPQ1GC430FtlIaYBSTZ+mOnX2RPANviDojsriPNT3Kka+Q1Wh/F5Qd87C Hg7qFBb5cOuFWwRG/OzreZRZCS0D7bfABbqqvIx43d33SnB/IzF7iWvKb68HeZY9RZLs rLmE+MSokRC6SyjOfKaKYuTTtF6caRHbKVHDwPPIrBMkso8Qpl20z2na3Xb1Ymk1dbeV ALJdeSDpmSwOayQUiZLjLDInFgr7V+ZOvTXpzcLrnbn2Ibk0GssNqkUYgZo58/uaYiCB QUZmaRrI+9hBUDrbHZfGQgVcNp1LQB5Xbu/IN3Sc5VBwXRjVWdUOPtQqJ5i0ZyeAs89s FyvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jZJyOQ0w; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 la14si22045543ejc.142.2021.07.19.09.08.59; Mon, 19 Jul 2021 09:08:59 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=jZJyOQ0w; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S1347027AbhGSP0N (ORCPT + 12 others); Mon, 19 Jul 2021 11:26:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:38166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347858AbhGSPWK (ORCPT ); Mon, 19 Jul 2021 11:22:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9C9ED613AE; Mon, 19 Jul 2021 15:59:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626710391; bh=nXyHw/DQ+3MHnoET8dBcqqnuoyNIonAdyS8lNG25KEU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jZJyOQ0wyzZ+LKIx6TERvItNk8rs6qA4Lw8JIKBLmeYgkvzLPb8UH0xRKnNprwphj pHHZPviKd2kT9mfqbAwtXmBzE1k7M7wpUtbxksR8/niwUwfEA1unXNeke8QfQKwcXM R5crBx3BT7cwyLub+dYdT7LAHEvyblwF9or66ICg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Zhen Lei , Krzysztof Kozlowski , Sasha Levin Subject: [PATCH 5.10 197/243] memory: pl353: Fix error return code in pl353_smc_probe() Date: Mon, 19 Jul 2021 16:53:46 +0200 Message-Id: <20210719144947.288786629@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144940.904087935@linuxfoundation.org> References: <20210719144940.904087935@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Zhen Lei [ Upstream commit 76e5624f3f9343a621dd3f4006f4e4d9c3f91e33 ] When no child nodes are matched, an appropriate error code -ENODEV should be returned. However, we currently do not explicitly assign this error code to 'err'. As a result, 0 was incorrectly returned. Fixes: fee10bd22678 ("memory: pl353: Add driver for arm pl353 static memory controller") Reported-by: Hulk Robot Signed-off-by: Zhen Lei Link: https://lore.kernel.org/r/20210515040004.6983-1-thunder.leizhen@huawei.com Signed-off-by: Krzysztof Kozlowski Signed-off-by: Sasha Levin --- drivers/memory/pl353-smc.c | 1 + 1 file changed, 1 insertion(+) -- 2.30.2 diff --git a/drivers/memory/pl353-smc.c b/drivers/memory/pl353-smc.c index b42804b1801e..cc01979780d8 100644 --- a/drivers/memory/pl353-smc.c +++ b/drivers/memory/pl353-smc.c @@ -407,6 +407,7 @@ static int pl353_smc_probe(struct amba_device *adev, const struct amba_id *id) break; } if (!match) { + err = -ENODEV; dev_err(&adev->dev, "no matching children\n"); goto out_clk_disable; }