projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d84680d
)
drm/aperture: Fix missing unlock on error in devm_aperture_acquire()
author
Zou Wei
<zou_wei@huawei.com>
Thu, 13 May 2021 08:46:04 +0000
(16:46 +0800)
committer
Thomas Zimmermann
<tzimmermann@suse.de>
Thu, 13 May 2021 13:06:32 +0000
(15:06 +0200)
Add the missing unlock before return from function devm_aperture_acquire()
in the error handling case.
Signed-off-by: Zou Wei <zou_wei@huawei.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 730e7992dc1b ("drm/aperture: Add infrastructure for aperture ownership")
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Maxime Ripard <maxime@cerno.tech>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Link:
https://patchwork.freedesktop.org/patch/msgid/1620895564-52367-1-git-send-email-zou_wei@huawei.com
drivers/gpu/drm/drm_aperture.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/drm_aperture.c
b/drivers/gpu/drm/drm_aperture.c
index 33bf018c3bdf7ceef13ab60bb9e58a1ee8f6dbad..9335d9d6cf9ae82c219276e6847fbbcf8e4c2852 100644
(file)
--- a/
drivers/gpu/drm/drm_aperture.c
+++ b/
drivers/gpu/drm/drm_aperture.c
@@
-164,13
+164,17
@@
static int devm_aperture_acquire(struct drm_device *dev,
list_for_each(pos, &drm_apertures) {
ap = container_of(pos, struct drm_aperture, lh);
- if (overlap(base, end, ap->base, ap->base + ap->size))
+ if (overlap(base, end, ap->base, ap->base + ap->size)) {
+ mutex_unlock(&drm_apertures_lock);
return -EBUSY;
+ }
}
ap = devm_kzalloc(dev->dev, sizeof(*ap), GFP_KERNEL);
- if (!ap)
+ if (!ap) {
+ mutex_unlock(&drm_apertures_lock);
return -ENOMEM;
+ }
ap->dev = dev;
ap->base = base;