In drm_remove_magic, free the magic entry when it is found instead of
attempting to free a NULL reference in the error case. From Yorick Hardy.
This commit is contained in:
parent
b7b1f2ee87
commit
4ce279101e
|
@ -110,13 +110,14 @@ static int drm_remove_magic(drm_device_t *dev, drm_magic_t magic)
|
|||
if (prev) {
|
||||
prev->next = pt->next;
|
||||
}
|
||||
pt->priv->magic = 0;
|
||||
DRM_UNLOCK();
|
||||
free(pt, M_DRM);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
DRM_UNLOCK();
|
||||
|
||||
free(pt, M_DRM);
|
||||
return DRM_ERR(EINVAL);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue