Skip to content

Commit 757b90b

Browse files
lucacoelhohogander
authored andcommitted
drm/i915/display: pre-initialize some values in probe_gmdid_display()
When intel_display_device_probe() (and, subsequently, probe_gmdid_display()) returns, the caller expects ver, rel and step to be initialized. Since there's no way to check that there was a failure and no_display was returned without some further refactoring, pre-initiliaze all these values to zero to keep it simple and safe. Signed-off-by: Luca Coelho <[email protected]> Reviewed-by: Suraj Kandpal <[email protected]> Signed-off-by: Jouni Högander <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 2aa01e4 commit 757b90b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/gpu/drm/i915/display/intel_display_device.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,15 @@ probe_gmdid_display(struct drm_i915_private *i915, u16 *ver, u16 *rel, u16 *step
800800
u32 val;
801801
int i;
802802

803+
/* The caller expects to ver, rel and step to be initialized
804+
* here, and there's no good way to check when there was a
805+
* failure and no_display was returned. So initialize all these
806+
* values here zero, to be sure.
807+
*/
808+
*ver = 0;
809+
*rel = 0;
810+
*step = 0;
811+
803812
addr = pci_iomap_range(pdev, 0, i915_mmio_reg_offset(GMD_ID_DISPLAY), sizeof(u32));
804813
if (!addr) {
805814
drm_err(&i915->drm, "Cannot map MMIO BAR to read display GMD_ID\n");

0 commit comments

Comments
 (0)