aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhinav Kumar <[email protected]>2021-03-05 11:17:18 -0800
committerRob Clark <[email protected]>2021-04-07 11:05:44 -0700
commit7d649cfe0314aad2ba18042885ab9de2f13ad809 (patch)
treec51b6c9eb2e89107d0210b9072224e2e371a87f5
parent86bf254549badbf754ace6b09f044fe18a959f28 (diff)
drm/msm/dp: Fix incorrect NULL check kbot warnings in DP driver
Fix an incorrect NULL check reported by kbot in the MSM DP driver smatch warnings: drivers/gpu/drm/msm/dp/dp_hpd.c:37 dp_hpd_connect() error: we previously assumed 'hpd_priv->dp_cb' could be null (see line 37) Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Abhinav Kumar <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Clark <[email protected]>
-rw-r--r--drivers/gpu/drm/msm/dp/dp_hpd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/msm/dp/dp_hpd.c b/drivers/gpu/drm/msm/dp/dp_hpd.c
index 5b8fe32022b5..e1c90fa47411 100644
--- a/drivers/gpu/drm/msm/dp/dp_hpd.c
+++ b/drivers/gpu/drm/msm/dp/dp_hpd.c
@@ -34,8 +34,8 @@ int dp_hpd_connect(struct dp_usbpd *dp_usbpd, bool hpd)
dp_usbpd->hpd_high = hpd;
- if (!hpd_priv->dp_cb && !hpd_priv->dp_cb->configure
- && !hpd_priv->dp_cb->disconnect) {
+ if (!hpd_priv->dp_cb || !hpd_priv->dp_cb->configure
+ || !hpd_priv->dp_cb->disconnect) {
pr_err("hpd dp_cb not initialized\n");
return -EINVAL;
}