mirror of
https://github.com/torvalds/linux.git
synced 2026-11-01 19:30:03 +01:00
drm/nouveau: Fix cleanup bug in nouveau_drm_device_new()
Sashiko caught this while reviewing the patches for enabling atomic by default - if we fail to allocate the DRM device pointer, we'll attempt to free the error pointer that it returns rather than the actual struct. Let's fix this while we're at it. Signed-off-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Link: https://patch.msgid.link/20260813204803.2097176-2-lyude@redhat.com
This commit is contained in:
parent
568d4cb5dc
commit
db684a65df
|
|
@ -749,7 +749,8 @@ nouveau_drm_device_new(const struct drm_driver *drm_driver, struct device *paren
|
|||
drm->dev = drm_dev_alloc(drm_driver, parent);
|
||||
if (IS_ERR(drm->dev)) {
|
||||
ret = PTR_ERR(drm->dev);
|
||||
goto done;
|
||||
kfree(drm);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
drm->dev->dev_private = drm;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user