]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
drm: ctx release can happen before dev->ctxlist is allocated
authorDave Airlie <airlied@starflyer.(none)>
Thu, 7 Jul 2005 10:17:42 +0000 (20:17 +1000)
committerDave Airlie <airlied@linux.ie>
Thu, 7 Jul 2005 10:17:42 +0000 (20:17 +1000)
From: Jon Smirl <jonsmirl@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
drivers/char/drm/drm_fops.c

index 7f9b00c6d244928c8ee6072a8b0e253f20d22e29..a53322d8c2296d3fcec073f1d6e06a6d95e745d7 100644 (file)
@@ -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 ) {