Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3037192pxb; Mon, 18 Oct 2021 07:04:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzP1eEEL9PQQtAse5baIFMavnpKOkPBnv5y41mH6+3QMXAKN72w0hC3j1P5BPUxXapYQSGs X-Received: by 2002:a65:64d7:: with SMTP id t23mr23635555pgv.237.1634565879393; Mon, 18 Oct 2021 07:04:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634565879; cv=none; d=google.com; s=arc-20160816; b=nJ4XW5NRrQEKOOeT/NMvy65ZkPnAsRy8F+VAiLFvEi4hoRlG8mR0Xz/OAK9rjXQInP jWt+0GXggdtDLzJ7pOQFLAnXBXtrDeybZ6TrfHSPhjn59/ZetwycsO5pyCqJ5H2Q5+jI xxs/DkbGq4dnAFaiH/21nOh2lMAMBk5D23Jx4DkFe3af9FK9CMCqyJPSQp7Ob+zVxXsf uKnRvc7WvdC7dFmb/faxi1NXtnvpxVTza9OPvBAPoV18uA3kvEI0VC73zF4v3iVdANDs KDakGJviVygQXfX+V+5oBbJv7vqXAtEVKrxcEaeszkZ/l9ti6kFi3qEpeHRNDu5we6l7 m2rg== 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=Pz0q/Rzuo5yTrKXMCrFAbUhCofCsm/vnm0VPa9CoIYk=; b=QnYAo1KFVEftPy5CCBYrafDJ5Q8EYRjDrrpM+7WPvisCgCvGLi2w+p2zu/mD4acD3u JOl9JCmlewtTVBQ81HGvw7K4Qp+kmDK8FiojomwitsVV/HKybEL8d+jT+BE1luirkx7B TWDGzCZZ2Nse8VLbZp/tMtMjBXPirHO4uizbrESlImNB5avzG3l8pRK28RLdRYAp9ucG Q4ZLPwkT+YqdHCq++gU3YglF0i6eq4vG/+9Kt6F26/wZYGDy765D6gTnnP45wUBfdrD5 Kjfdm/aic15svft4N7zeX8yChmZgi8Zl7OIo7yDY9YrVVWWfIEFO3tC/iTnM+opi5nqB Wa0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DgvCDqsX; 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 u39si6613560pfg.199.2021.10.18.07.04.24; Mon, 18 Oct 2021 07:04:39 -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=DgvCDqsX; 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 S232785AbhJROFD (ORCPT + 99 others); Mon, 18 Oct 2021 10:05:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:39178 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234733AbhJROA4 (ORCPT ); Mon, 18 Oct 2021 10:00:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9471F61A60; Mon, 18 Oct 2021 13:42:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634564552; bh=9hzMontMsUhbzSt7RKjl9Umgu7vEXrNj9CFgvEGciU4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DgvCDqsXWlYVyIDQiiIkaSctogIibOfIA9Er+I+jcn8mzqpRJeiHLu46rAJsMrpyD i8z8/VcFtDwT1Yb3y7KN+xzv+nf6wGRzUp+NIsBgLhT8ia3C1GutufGbs+wL75nZZA 11ENoz9MTlV/uS3TQ4Ke2GGeoeHdlHhgIf1waNHQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Rob Clark Subject: [PATCH 5.14 132/151] drm/msm/a3xx: fix error handling in a3xx_gpu_init() Date: Mon, 18 Oct 2021 15:25:11 +0200 Message-Id: <20211018132344.954115938@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132340.682786018@linuxfoundation.org> References: <20211018132340.682786018@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 commit 3eda901995371d390ef82d0b6462f4ea8efbcfdf upstream. These error paths returned 1 on failure, instead of a negative error code. This would lead to an Oops in the caller. A second problem is that the check for "if (ret != -ENODATA)" did not work because "ret" was set to 1. Fixes: 5785dd7a8ef0 ("drm/msm: Fix duplicate gpu node in icc summary") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20211001125904.GK2283@kili Signed-off-by: Rob Clark Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/msm/adreno/a3xx_gpu.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) --- a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c @@ -571,13 +571,14 @@ struct msm_gpu *a3xx_gpu_init(struct drm } icc_path = devm_of_icc_get(&pdev->dev, "gfx-mem"); - ret = IS_ERR(icc_path); - if (ret) + if (IS_ERR(icc_path)) { + ret = PTR_ERR(icc_path); goto fail; + } ocmem_icc_path = devm_of_icc_get(&pdev->dev, "ocmem"); - ret = IS_ERR(ocmem_icc_path); - if (ret) { + if (IS_ERR(ocmem_icc_path)) { + ret = PTR_ERR(ocmem_icc_path); /* allow -ENODATA, ocmem icc is optional */ if (ret != -ENODATA) goto fail;