* [Intel-gfx] [PATCH] drm/i915: Fix possible NULL pointer dereferences in i9xx_update_wm()
@ 2021-12-16 23:21 Harish Chegondi
2021-12-17 9:50 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork
2021-12-17 10:18 ` [Intel-gfx] [PATCH] " Jani Nikula
0 siblings, 2 replies; 3+ messages in thread
From: Harish Chegondi @ 2021-12-16 23:21 UTC (permalink / raw)
To: intel-gfx; +Cc: Jani Nikula
Check return pointer from intel_crtc_for_plane() before dereferencing
it, as it can be NULL.
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 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index bdf97a8c9ef3..c7a4d8d971d7 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -2373,7 +2373,7 @@ static void i9xx_update_wm(struct drm_i915_private *dev_priv)
else
fifo_size = i9xx_get_fifo_size(dev_priv, PLANE_A);
crtc = intel_crtc_for_plane(dev_priv, PLANE_A);
- if (intel_crtc_active(crtc)) {
+ if (crtc && intel_crtc_active(crtc)) {
const struct drm_display_mode *pipe_mode =
&crtc->config->hw.pipe_mode;
const struct drm_framebuffer *fb =
@@ -2403,7 +2403,7 @@ static void i9xx_update_wm(struct drm_i915_private *dev_priv)
else
fifo_size = i9xx_get_fifo_size(dev_priv, PLANE_B);
crtc = intel_crtc_for_plane(dev_priv, PLANE_B);
- if (intel_crtc_active(crtc)) {
+ if (crtc && intel_crtc_active(crtc)) {
const struct drm_display_mode *pipe_mode =
&crtc->config->hw.pipe_mode;
const struct drm_framebuffer *fb =
--
2.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* [Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: Fix possible NULL pointer dereferences in i9xx_update_wm()
2021-12-16 23:21 [Intel-gfx] [PATCH] drm/i915: Fix possible NULL pointer dereferences in i9xx_update_wm() Harish Chegondi
@ 2021-12-17 9:50 ` Patchwork
2021-12-17 10:18 ` [Intel-gfx] [PATCH] " Jani Nikula
1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2021-12-17 9:50 UTC (permalink / raw)
To: Harish Chegondi; +Cc: intel-gfx
[-- Attachment #1: Type: text/plain, Size: 7588 bytes --]
== Series Details ==
Series: drm/i915: Fix possible NULL pointer dereferences in i9xx_update_wm()
URL : https://patchwork.freedesktop.org/series/98154/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_11009 -> Patchwork_21863
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_21863 absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in Patchwork_21863, please notify your bug team to allow them
to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21863/index.html
Participating hosts (43 -> 34)
------------------------------
Additional (1): fi-skl-guc
Missing (10): fi-bxt-dsi bat-dg1-6 bat-dg1-5 fi-icl-u2 fi-bsw-cyan bat-adlp-6 bat-adlp-4 fi-bdw-samus bat-jsl-2 bat-jsl-1
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_21863:
### IGT changes ###
#### Possible regressions ####
* igt@core_hotunplug@unbind-rebind:
- fi-blb-e6850: [PASS][1] -> [FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11009/fi-blb-e6850/igt@core_hotunplug@unbind-rebind.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21863/fi-blb-e6850/igt@core_hotunplug@unbind-rebind.html
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses.
They do not affect the overall result.
* igt@i915_selftest@live@execlists:
- {fi-jsl-1}: [PASS][3] -> [INCOMPLETE][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11009/fi-jsl-1/igt@i915_selftest@live@execlists.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21863/fi-jsl-1/igt@i915_selftest@live@execlists.html
Known issues
------------
Here are the changes found in Patchwork_21863 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_huc_copy@huc-copy:
- fi-skl-6600u: NOTRUN -> [SKIP][5] ([fdo#109271] / [i915#2190])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21863/fi-skl-6600u/igt@gem_huc_copy@huc-copy.html
* igt@gem_lmem_swapping@basic:
- fi-skl-guc: NOTRUN -> [SKIP][6] ([fdo#109271] / [i915#4613]) +3 similar issues
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21863/fi-skl-guc/igt@gem_lmem_swapping@basic.html
* igt@gem_lmem_swapping@verify-random:
- fi-skl-6600u: NOTRUN -> [SKIP][7] ([fdo#109271] / [i915#4613]) +3 similar issues
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21863/fi-skl-6600u/igt@gem_lmem_swapping@verify-random.html
* igt@i915_selftest@live@hangcheck:
- fi-hsw-4770: [PASS][8] -> [INCOMPLETE][9] ([i915#3303])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11009/fi-hsw-4770/igt@i915_selftest@live@hangcheck.html
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21863/fi-hsw-4770/igt@i915_selftest@live@hangcheck.html
- fi-snb-2600: [PASS][10] -> [INCOMPLETE][11] ([i915#3921])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11009/fi-snb-2600/igt@i915_selftest@live@hangcheck.html
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21863/fi-snb-2600/igt@i915_selftest@live@hangcheck.html
* igt@kms_chamelium@dp-crc-fast:
- fi-skl-guc: NOTRUN -> [SKIP][12] ([fdo#109271] / [fdo#111827]) +8 similar issues
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21863/fi-skl-guc/igt@kms_chamelium@dp-crc-fast.html
* igt@kms_chamelium@vga-edid-read:
- fi-skl-6600u: NOTRUN -> [SKIP][13] ([fdo#109271] / [fdo#111827]) +8 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21863/fi-skl-6600u/igt@kms_chamelium@vga-edid-read.html
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-skl-guc: NOTRUN -> [SKIP][14] ([fdo#109271]) +28 similar issues
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21863/fi-skl-guc/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
- fi-skl-6600u: NOTRUN -> [SKIP][15] ([fdo#109271]) +2 similar issues
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21863/fi-skl-6600u/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy.html
* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d:
- fi-skl-6600u: NOTRUN -> [SKIP][16] ([fdo#109271] / [i915#533])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21863/fi-skl-6600u/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html
- fi-skl-guc: NOTRUN -> [SKIP][17] ([fdo#109271] / [i915#533])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21863/fi-skl-guc/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html
* igt@kms_psr@primary_page_flip:
- fi-skl-6600u: NOTRUN -> [FAIL][18] ([i915#4547])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21863/fi-skl-6600u/igt@kms_psr@primary_page_flip.html
* igt@runner@aborted:
- fi-hsw-4770: NOTRUN -> [FAIL][19] ([fdo#109271] / [i915#1436] / [i915#4312])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21863/fi-hsw-4770/igt@runner@aborted.html
#### Possible fixes ####
* igt@gem_exec_suspend@basic-s3:
- fi-tgl-1115g4: [FAIL][20] ([i915#1888]) -> [PASS][21]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11009/fi-tgl-1115g4/igt@gem_exec_suspend@basic-s3.html
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21863/fi-tgl-1115g4/igt@gem_exec_suspend@basic-s3.html
* igt@gem_flink_basic@bad-flink:
- fi-skl-6600u: [FAIL][22] ([i915#4547]) -> [PASS][23]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11009/fi-skl-6600u/igt@gem_flink_basic@bad-flink.html
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21863/fi-skl-6600u/igt@gem_flink_basic@bad-flink.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#3303]: https://gitlab.freedesktop.org/drm/intel/issues/3303
[i915#3921]: https://gitlab.freedesktop.org/drm/intel/issues/3921
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4547]: https://gitlab.freedesktop.org/drm/intel/issues/4547
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
Build changes
-------------
* Linux: CI_DRM_11009 -> Patchwork_21863
CI-20190529: 20190529
CI_DRM_11009: 9efbfd937cc876674559ddf8fb1897a00c10019b @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6313: 1793ed798cc09966c27bf478781e0c1d6bb23bad @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_21863: 00b81a40ee8733a6ddf0659ff7ef320440aa094b @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
00b81a40ee87 drm/i915: Fix possible NULL pointer dereferences in i9xx_update_wm()
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21863/index.html
[-- Attachment #2: Type: text/html, Size: 9492 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [Intel-gfx] [PATCH] drm/i915: Fix possible NULL pointer dereferences in i9xx_update_wm()
2021-12-16 23:21 [Intel-gfx] [PATCH] drm/i915: Fix possible NULL pointer dereferences in i9xx_update_wm() Harish Chegondi
2021-12-17 9:50 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork
@ 2021-12-17 10:18 ` Jani Nikula
1 sibling, 0 replies; 3+ messages in thread
From: Jani Nikula @ 2021-12-17 10:18 UTC (permalink / raw)
To: Harish Chegondi, intel-gfx
On Thu, 16 Dec 2021, Harish Chegondi <harish.chegondi@intel.com> wrote:
> Check return pointer from intel_crtc_for_plane() before dereferencing
> it, as it can be NULL.
If you're doing this to satisfy some static analyzer, in these cases the
code would read *much* better if you added the NULL check inside
intel_crtc_active().
BR,
Jani.
>
> 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 | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index bdf97a8c9ef3..c7a4d8d971d7 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -2373,7 +2373,7 @@ static void i9xx_update_wm(struct drm_i915_private *dev_priv)
> else
> fifo_size = i9xx_get_fifo_size(dev_priv, PLANE_A);
> crtc = intel_crtc_for_plane(dev_priv, PLANE_A);
> - if (intel_crtc_active(crtc)) {
> + if (crtc && intel_crtc_active(crtc)) {
> const struct drm_display_mode *pipe_mode =
> &crtc->config->hw.pipe_mode;
> const struct drm_framebuffer *fb =
> @@ -2403,7 +2403,7 @@ static void i9xx_update_wm(struct drm_i915_private *dev_priv)
> else
> fifo_size = i9xx_get_fifo_size(dev_priv, PLANE_B);
> crtc = intel_crtc_for_plane(dev_priv, PLANE_B);
> - if (intel_crtc_active(crtc)) {
> + if (crtc && intel_crtc_active(crtc)) {
> const struct drm_display_mode *pipe_mode =
> &crtc->config->hw.pipe_mode;
> const struct drm_framebuffer *fb =
--
Jani Nikula, Intel Open Source Graphics Center
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-12-17 10:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-16 23:21 [Intel-gfx] [PATCH] drm/i915: Fix possible NULL pointer dereferences in i9xx_update_wm() Harish Chegondi
2021-12-17 9:50 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork
2021-12-17 10:18 ` [Intel-gfx] [PATCH] " Jani Nikula
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox