lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1614850829-31802-1-git-send-email-kalyan_t@codeaurora.org>
Date:   Thu,  4 Mar 2021 01:40:29 -0800
From:   Kalyan Thota <kalyan_t@...eaurora.org>
To:     y@...lcomm.com, dri-devel@...ts.freedesktop.org,
        linux-arm-msm@...r.kernel.org, freedreno@...ts.freedesktop.org,
        devicetree@...r.kernel.org
Cc:     Kalyan Thota <kalyan_t@...eaurora.org>,
        linux-kernel@...r.kernel.org, robdclark@...il.com,
        dianders@...omium.org, mkrishn@...eaurora.org,
        dan.carpenter@...cle.com
Subject: [v1] drm/msm/disp/dpu1: fix warning reported by kernel bot in dpu driver

Fix a warning, pointing to an early deference of a variable before
check. This bug was introduced in the following commit.

commit 4259ff7ae509
("drm/msm/dpu: add support for pcc color block in dpu driver")

Reported-by: kernel test robot <lkp@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
Signed-off-by: Kalyan Thota <kalyan_t@...eaurora.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c
index a7a2453..0f9974c 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c
@@ -26,10 +26,16 @@ static void dpu_setup_dspp_pcc(struct dpu_hw_dspp *ctx,
 		struct dpu_hw_pcc_cfg *cfg)
 {
 
-	u32 base = ctx->cap->sblk->pcc.base;
+	u32 base;
 
-	if (!ctx || !base) {
-		DRM_ERROR("invalid ctx %pK pcc base 0x%x\n", ctx, base);
+	if (!ctx) {
+		DRM_ERROR("invalid dspp ctx %pK\n", ctx);
+		return;
+	}
+
+	base = ctx->cap->sblk->pcc.base;
+	if (!base) {
+		DRM_ERROR("invalid pcc base 0x%x\n", base);
 		return;
 	}
 
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ