Skip to content

Commit

Permalink
drm: avoid kernel oops in some error paths calling drm_lastclose
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Airlie <airlied@linux.ie>
  • Loading branch information
Thomas Hellstrom authored and Dave Airlie committed Sep 21, 2006
1 parent bd5af07 commit 0a0c721
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/char/drm/drm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,12 @@ int drm_lastclose(drm_device_t * dev)
del_timer(&dev->timer);

/* Clear pid list */
list_for_each_entry_safe(pt, next, &dev->magicfree, head) {
list_del(&pt->head);
drm_ht_remove_item(&dev->magiclist, &pt->hash_item);
drm_free(pt, sizeof(*pt), DRM_MEM_MAGIC);
if (dev->magicfree.next) {
list_for_each_entry_safe(pt, next, &dev->magicfree, head) {
list_del(&pt->head);
drm_ht_remove_item(&dev->magiclist, &pt->hash_item);
drm_free(pt, sizeof(*pt), DRM_MEM_MAGIC);
}
}

/* Clear AGP information */
Expand Down

0 comments on commit 0a0c721

Please sign in to comment.