Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2483668pxj; Mon, 10 May 2021 04:11:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqs9+/8A36fQe4Sl5WQGtNI1E1a1S27E7JiXAnzGp9mUGQB61r+IMRHga98+G/j11grUOM X-Received: by 2002:a05:6602:181:: with SMTP id m1mr18313154ioo.153.1620645103330; Mon, 10 May 2021 04:11:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645103; cv=none; d=google.com; s=arc-20160816; b=cuZjfaLYCjuNgGo/mvxXTyCN+sCoPnGK2PDE5qCCfnzOvYTBXiet+pntwCXN34Qkf/ 8k0yfHQmYVRIG98jhAyLBWnjfw5Z9abcxuYxfbMyMWhU5cDzjL3YioAW2q4mz+xT9PK6 8vggm5ImTTX6pGZJb3ucplxzsI2D7gAqfwu/pECTGacnky0pZedXtc1WchqMR+/nAnd7 6xPoh1St3of05rESWjZZl2phkBNGNxU78NYCGdO7k5ZuUmJKSB40x4Yi54hQ/HJRE2xy vf9awpjLeJDLGNrdUIMMqXYBdjr9OlmbMrocYd6HEYyWPo1BRTEzdA2v2Nc/c4IXHuJV L1WA== 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=+8ucIj8i/K7jXqb6h1TXPU5Wa6/pscPAHtJAEQ4MYtY=; b=wjiRrJCAQt0ThXSEK58SmmmPM6fcWrFLV5C30dGPM/Ed8Aw8yg3pJAuIAh23pMJE6n aRjfPrzVmMyNXB5p493Rmr/LtGPtN4SZAW7epM9XvMzdThHvjJONQ+S0Udi/YKxrPXUm MTJ5vMTCH2aynM24Dsrg59FRZvk817mBuarhJ6PFGhwRc8vQ2JCL7NocqeZTdlD/L00E sjP/myRTFVj2K/7LjHYt88nVT6G0x1naLOPOeI7+tn6RVrzbYOQ7SUgY3gapdB3g8hQI fEjsFIxSkAUJ8IwYgWpOERQT2GHTlRYL39A8g8hAXEEQVePa+w931tM+1Gz5FmCO7yzE JD3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Oyyz8587; 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 g11si15626143ion.60.2021.05.10.04.11.31; Mon, 10 May 2021 04:11:43 -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=Oyyz8587; 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 S236695AbhEJLIf (ORCPT + 99 others); Mon, 10 May 2021 07:08:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:58338 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232473AbhEJKsj (ORCPT ); Mon, 10 May 2021 06:48:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DB0C2619C5; Mon, 10 May 2021 10:38:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643084; bh=9nmZ9Pr/nDgFEeeAliQu9uMjuWaXNj3UsCrrHaNqzEs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Oyyz85878UgVhy9tvnIWNZV+QUBz2m3I82rZ4cR4jrMyLoDPEIRYiEV89MxGopPFu 5TSOEN1wMkFdiKcWxV+AFApXfzXB7NhkZUUrd2KCIBdnxgPhoF8zfEkyCTtmUOSIRG H8hqWJc1H5KxagYL7xGAk5yRCbew8bRMRPwpGhKA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Dan Carpenter , Abhinav Kumar , Stephen Boyd , Rob Clark , Sasha Levin Subject: [PATCH 5.10 172/299] drm/msm/dp: Fix incorrect NULL check kbot warnings in DP driver Date: Mon, 10 May 2021 12:19:29 +0200 Message-Id: <20210510102010.642657145@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@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: Abhinav Kumar [ Upstream commit 7d649cfe0314aad2ba18042885ab9de2f13ad809 ] 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 Reported-by: Dan Carpenter Signed-off-by: Abhinav Kumar Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1614971839-2686-2-git-send-email-abhinavk@codeaurora.org Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/dp/dp_hpd.c | 4 ++-- 1 file 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; } -- 2.30.2