mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-24 06:35:44 +08:00
drm: Add missing drm_vblank_put() along queue vblank error path
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Kristian Høgsberg <krh@bitplanet.net> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
e516c7df4c
commit
ea5d552c73
@ -585,10 +585,13 @@ static int drm_queue_vblank_event(struct drm_device *dev, int pipe,
|
|||||||
struct timeval now;
|
struct timeval now;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
unsigned int seq;
|
unsigned int seq;
|
||||||
|
int ret;
|
||||||
|
|
||||||
e = kzalloc(sizeof *e, GFP_KERNEL);
|
e = kzalloc(sizeof *e, GFP_KERNEL);
|
||||||
if (e == NULL)
|
if (e == NULL) {
|
||||||
return -ENOMEM;
|
ret = -ENOMEM;
|
||||||
|
goto err_put;
|
||||||
|
}
|
||||||
|
|
||||||
e->pipe = pipe;
|
e->pipe = pipe;
|
||||||
e->base.pid = current->pid;
|
e->base.pid = current->pid;
|
||||||
@ -603,9 +606,8 @@ static int drm_queue_vblank_event(struct drm_device *dev, int pipe,
|
|||||||
spin_lock_irqsave(&dev->event_lock, flags);
|
spin_lock_irqsave(&dev->event_lock, flags);
|
||||||
|
|
||||||
if (file_priv->event_space < sizeof e->event) {
|
if (file_priv->event_space < sizeof e->event) {
|
||||||
spin_unlock_irqrestore(&dev->event_lock, flags);
|
ret = -EBUSY;
|
||||||
kfree(e);
|
goto err_unlock;
|
||||||
return -ENOMEM;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
file_priv->event_space -= sizeof e->event;
|
file_priv->event_space -= sizeof e->event;
|
||||||
@ -638,6 +640,13 @@ static int drm_queue_vblank_event(struct drm_device *dev, int pipe,
|
|||||||
spin_unlock_irqrestore(&dev->event_lock, flags);
|
spin_unlock_irqrestore(&dev->event_lock, flags);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
err_unlock:
|
||||||
|
spin_unlock_irqrestore(&dev->event_lock, flags);
|
||||||
|
kfree(e);
|
||||||
|
err_put:
|
||||||
|
drm_vblank_put(dev, e->pipe);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user