浏览代码

drm: ctx release can happen before dev->ctxlist is allocated

From: Jon Smirl <jonsmirl@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Dave Airlie 20 年之前
父节点
当前提交
f650130803
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/char/drm/drm_fops.c

+ 1 - 1
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 ) {