summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Brace <kevinbrace@gmx.com>2021-12-27 16:37:07 -0600
committerKevin Brace <kevinbrace@gmx.com>2021-12-27 16:37:07 -0600
commit0d6ae650b0feb2fcfa19788e1e9b572026a8486d (patch)
tree8a1c9581f56b25d9dc8fc0034407aeb05f64e847
parent3bef18990ed2769442be8e501262330f83d9c0a6 (diff)
drm/openchrome: Fix for sporadic cursor disable code crash
What happens is that openchrome_cursor_atomic_disable() is occassionally handed a null pointer for its crtc parameter. Just check for a null pointer before disabling the display of the cursor. Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
-rw-r--r--drivers/gpu/drm/openchrome/openchrome_cursor.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/drm/openchrome/openchrome_cursor.c b/drivers/gpu/drm/openchrome/openchrome_cursor.c
index b9a685488c97..dc662fa02fb1 100644
--- a/drivers/gpu/drm/openchrome/openchrome_cursor.c
+++ b/drivers/gpu/drm/openchrome/openchrome_cursor.c
@@ -49,9 +49,9 @@
#include "openchrome_drv.h"
-static void openchrome_hide_cursor(struct drm_device *dev,
- struct drm_crtc *crtc)
+static void openchrome_hide_cursor(struct drm_crtc *crtc)
{
+ struct drm_device *dev = crtc->dev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
struct via_crtc *iga = container_of(crtc,
struct via_crtc, base);
@@ -396,12 +396,13 @@ void openchrome_cursor_atomic_disable(struct drm_plane *plane,
{
struct drm_plane_state *new_state =
drm_atomic_get_new_plane_state(state, plane);
- struct drm_device *dev = plane->dev;
struct drm_crtc *crtc = new_state->crtc;
DRM_DEBUG_KMS("Entered %s.\n", __func__);
- openchrome_hide_cursor(dev, crtc);
+ if (crtc) {
+ openchrome_hide_cursor(crtc);
+ }
DRM_DEBUG_KMS("Exiting %s.\n", __func__);
}