From f650130803c4c0b5e5d76eff24faae722e3a69e2 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 7 Jul 2005 20:17:42 +1000 Subject: [PATCH] drm: ctx release can happen before dev->ctxlist is allocated From: Jon Smirl Signed-off-by: Dave Airlie --- drivers/char/drm/drm_fops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/drm/drm_fops.c b/drivers/char/drm/drm_fops.c index 7f9b00c6d2..a53322d8c2 100644 --- a/drivers/char/drm/drm_fops.c +++ b/drivers/char/drm/drm_fops.c @@ -259,7 +259,7 @@ int drm_release( struct inode *inode, struct file *filp ) drm_fasync( -1, filp, 0 ); down( &dev->ctxlist_sem ); - if ( !list_empty( &dev->ctxlist->head ) ) { + if ( dev->ctxlist && (!list_empty(&dev->ctxlist->head))) { drm_ctx_list_t *pos, *n; list_for_each_entry_safe( pos, n, &dev->ctxlist->head, head ) { -- 2.39.5