linux-stable/drivers/gpu/drm/gma500
Xiaomeng Tong 380e0d2bf5 gma500: fix an incorrect NULL check on list iterator
commit bdef417d84 upstream.

The bug is here:
	return crtc;

The list iterator value 'crtc' will *always* be set and non-NULL by
list_for_each_entry(), so it is incorrect to assume that the iterator
value will be NULL if the list is empty or no element is found.

To fix the bug, return 'crtc' when found, otherwise return NULL.

Cc: stable@vger.kernel.org
fixes: 89c78134cc ("gma500: Add Poulsbo support")
Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220327052028.2013-1-xiam0nd.tong@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-09 10:26:29 +02:00
..
backlight.c drm/gma500: Replace references to dev_private with helper function 2021-09-23 09:40:20 +02:00
cdv_device.c drm/gma500: Embed struct drm_device in struct drm_psb_private 2021-09-23 09:40:39 +02:00
cdv_device.h
cdv_intel_crt.c
cdv_intel_display.c drm/gma500: Replace references to dev_private with helper function 2021-09-23 09:40:20 +02:00
cdv_intel_dp.c drm/gma500: Replace references to dev_private with helper function 2021-09-23 09:40:20 +02:00
cdv_intel_hdmi.c
cdv_intel_lvds.c drm/gma500: Replace references to dev_private with helper function 2021-09-23 09:40:20 +02:00
framebuffer.c drm/gma500: Rename struct gtt_range to struct psb_gem_object 2021-10-19 10:38:54 +02:00
framebuffer.h
gem.c drm/gma500: Rename struct gtt_range to struct psb_gem_object 2021-10-19 10:38:54 +02:00
gem.h drm/gma500: Rename struct gtt_range to struct psb_gem_object 2021-10-19 10:38:54 +02:00
gma_device.c drm/gma500: Replace references to dev_private with helper function 2021-09-23 09:40:20 +02:00
gma_device.h
gma_display.c drm/gma500: Rename struct gtt_range to struct psb_gem_object 2021-10-19 10:38:54 +02:00
gma_display.h
gtt.c drm/gma500: Rename struct gtt_range to struct psb_gem_object 2021-10-19 10:38:54 +02:00
gtt.h drm/gma500: Rename struct gtt_range to struct psb_gem_object 2021-10-19 10:38:54 +02:00
intel_bios.c drm/gma500: Embed struct drm_device in struct drm_psb_private 2021-09-23 09:40:39 +02:00
intel_bios.h
intel_gmbus.c drm/gma500: Embed struct drm_device in struct drm_psb_private 2021-09-23 09:40:39 +02:00
intel_i2c.c
Kconfig
Makefile
mid_bios.c drm/gma500: Embed struct drm_device in struct drm_psb_private 2021-09-23 09:40:39 +02:00
mid_bios.h
mmu.c drm/gma500: Replace references to dev_private with helper function 2021-09-23 09:40:20 +02:00
mmu.h
oaktrail.h
oaktrail_crtc.c drm/gma500: Rename struct gtt_range to struct psb_gem_object 2021-10-19 10:38:54 +02:00
oaktrail_device.c drm/gma500: Replace references to dev_private with helper function 2021-09-23 09:40:20 +02:00
oaktrail_hdmi.c drm/gma500: Replace references to dev_private with helper function 2021-09-23 09:40:20 +02:00
oaktrail_hdmi_i2c.c
oaktrail_lvds.c drm/gma500: Replace references to dev_private with helper function 2021-09-23 09:40:20 +02:00
oaktrail_lvds_i2c.c drm/gma500: Replace references to dev_private with helper function 2021-09-23 09:40:20 +02:00
opregion.c drm/gma500: Embed struct drm_device in struct drm_psb_private 2021-09-23 09:40:39 +02:00
opregion.h
power.c drm/gma500: Replace references to dev_private with helper function 2021-09-23 09:40:20 +02:00
power.h
psb_device.c Revert "drm/gma500: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()" 2021-10-04 09:34:55 -04:00
psb_device.h
psb_drv.c drm/gma500: Remove generic DRM drivers in probe function 2021-10-21 09:32:51 +02:00
psb_drv.h drm/gma500: Embed struct drm_device in struct drm_psb_private 2021-09-23 09:40:39 +02:00
psb_intel_display.c gma500: fix an incorrect NULL check on list iterator 2022-06-09 10:26:29 +02:00
psb_intel_drv.h drm/gma500: Rename struct gtt_range to struct psb_gem_object 2021-10-19 10:38:54 +02:00
psb_intel_lvds.c drm/gma500: Replace references to dev_private with helper function 2021-09-23 09:40:20 +02:00
psb_intel_modes.c
psb_intel_reg.h
psb_intel_sdvo.c drm/gma500: Replace references to dev_private with helper function 2021-09-23 09:40:20 +02:00
psb_intel_sdvo_regs.h
psb_irq.c drm/gma500: Embed struct drm_device in struct drm_psb_private 2021-09-23 09:40:39 +02:00
psb_irq.h drm/gma500: Convert to Linux IRQ interfaces 2021-08-10 20:13:32 +02:00
psb_lid.c drm/gma500: Embed struct drm_device in struct drm_psb_private 2021-09-23 09:40:39 +02:00
psb_reg.h