Commit 0a0c721d authored by Thomas Hellstrom's avatar Thomas Hellstrom Committed by Dave Airlie

drm: avoid kernel oops in some error paths calling drm_lastclose

Signed-off-by: default avatarDave Airlie <airlied@linux.ie>
parent bd5af078
...@@ -155,10 +155,12 @@ int drm_lastclose(drm_device_t * dev) ...@@ -155,10 +155,12 @@ int drm_lastclose(drm_device_t * dev)
del_timer(&dev->timer); del_timer(&dev->timer);
/* Clear pid list */ /* Clear pid list */
list_for_each_entry_safe(pt, next, &dev->magicfree, head) { if (dev->magicfree.next) {
list_del(&pt->head); list_for_each_entry_safe(pt, next, &dev->magicfree, head) {
drm_ht_remove_item(&dev->magiclist, &pt->hash_item); list_del(&pt->head);
drm_free(pt, sizeof(*pt), DRM_MEM_MAGIC); drm_ht_remove_item(&dev->magiclist, &pt->hash_item);
drm_free(pt, sizeof(*pt), DRM_MEM_MAGIC);
}
} }
/* Clear AGP information */ /* Clear AGP information */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment