From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9FB73C433FE for ; Fri, 17 Dec 2021 16:12:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F3A4410E36B; Fri, 17 Dec 2021 16:12:55 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7481A10E36A for ; Fri, 17 Dec 2021 16:12:54 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10201"; a="263956416" X-IronPort-AV: E=Sophos;i="5.88,213,1635231600"; d="scan'208";a="263956416" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Dec 2021 08:08:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,213,1635231600"; d="scan'208";a="546436415" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.171]) by orsmga001.jf.intel.com with SMTP; 17 Dec 2021 08:08:38 -0800 Received: by stinkbox (sSMTP sendmail emulation); Fri, 17 Dec 2021 18:08:38 +0200 Date: Fri, 17 Dec 2021 18:08:38 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Harish Chegondi Message-ID: References: <20211217160255.1300348-1-harish.chegondi@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211217160255.1300348-1-harish.chegondi@intel.com> X-Patchwork-Hint: comment Subject: Re: [Intel-gfx] [PATCH v2] drm/i915: Fix possible NULL pointer dereferences in i9xx_update_wm() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jani Nikula , intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Fri, Dec 17, 2021 at 08:02:55AM -0800, Harish Chegondi wrote: > Check return pointer from intel_crtc_for_plane() before dereferencing > it, as it can be NULL. Can't actually bu NULL. But I guess no real harm in having the check if it shuts up some static analysis thing. > > v2: Moved the NULL check into intel_crtc_active(). > > Cc: Jani Nikula > Cc: Caz Yokoyama > Cc: Radhakrishna Sripada > Signed-off-by: Harish Chegondi > --- > drivers/gpu/drm/i915/intel_pm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c > index bdf97a8c9ef3..8b357ec35a4a 100644 > --- a/drivers/gpu/drm/i915/intel_pm.c > +++ b/drivers/gpu/drm/i915/intel_pm.c > @@ -877,7 +877,7 @@ static bool intel_crtc_active(struct intel_crtc *crtc) > * crtc->state->active once we have proper CRTC states wired up > * for atomic. > */ > - return crtc->active && crtc->base.primary->state->fb && > + return crtc && crtc->active && crtc->base.primary->state->fb && > crtc->config->hw.adjusted_mode.crtc_clock; > } > > -- > 2.31.1 -- Ville Syrjälä Intel