From: Jani Nikula <jani.nikula@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>,
"Harish Chegondi" <harish.chegondi@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2] drm/i915: Fix possible NULL pointer dereferences in i9xx_update_wm()
Date: Wed, 22 Dec 2021 10:30:08 +0200 [thread overview]
Message-ID: <87lf0dyrcf.fsf@intel.com> (raw)
In-Reply-To: <Yby2BrDPAE4eUxxX@intel.com>
On Fri, 17 Dec 2021, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> 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.
That's what I figured too, and better have it here than spread around
wherever this is called.
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
>
>>
>> v2: Moved the NULL check into intel_crtc_active().
>>
>> Cc: Jani Nikula <jani.nikula@intel.com>
>> Cc: Caz Yokoyama <caz.yokoyama@intel.com>
>> Cc: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
>> Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
>> ---
>> 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
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2021-12-22 8:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-17 16:02 [Intel-gfx] [PATCH v2] drm/i915: Fix possible NULL pointer dereferences in i9xx_update_wm() Harish Chegondi
2021-12-17 16:08 ` Ville Syrjälä
2021-12-22 8:30 ` Jani Nikula [this message]
2021-12-17 17:48 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: Fix possible NULL pointer dereferences in i9xx_update_wm() (rev2) Patchwork
2021-12-22 10:30 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Fix possible NULL pointer dereferences in i9xx_update_wm() (rev3) Patchwork
2021-12-22 12:40 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-01-07 15:57 ` Patchwork
2022-01-07 16:21 ` Patchwork
2022-01-07 19:25 ` [Intel-gfx] ✓ Fi.CI.IGT: success " Patchwork
2022-01-07 21:37 ` Matt Roper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lf0dyrcf.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=harish.chegondi@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox