diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-12-01 14:41:31 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-12-07 18:31:52 -0500 |
commit | ea5d552c73707645c53d42e8a71c9a4d9cbb85c1 (patch) | |
tree | 566a4e3dc33eb9bcee23c5930d8f44844565d4be | |
parent | e516c7df4cfe335a2ea220480cfac558dc738ae4 (diff) |
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>
-rw-r--r-- | drivers/gpu/drm/drm_irq.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 9d3a5030b6e1..722700d5d73e 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
@@ -585,10 +585,13 @@ static int drm_queue_vblank_event(struct drm_device *dev, int pipe, | |||
585 | struct timeval now; | 585 | struct timeval now; |
586 | unsigned long flags; | 586 | unsigned long flags; |
587 | unsigned int seq; | 587 | unsigned int seq; |
588 | int ret; | ||
588 | 589 | ||
589 | e = kzalloc(sizeof *e, GFP_KERNEL); | 590 | e = kzalloc(sizeof *e, GFP_KERNEL); |
590 | if (e == NULL) | 591 | if (e == NULL) { |
591 | return -ENOMEM; | 592 | ret = -ENOMEM; |
593 | goto err_put; | ||
594 | } | ||
592 | 595 | ||
593 | e->pipe = pipe; | 596 | e->pipe = pipe; |
594 | e->base.pid = current->pid; | 597 | e->base.pid = current->pid; |
@@ -603,9 +606,8 @@ static int drm_queue_vblank_event(struct drm_device *dev, int pipe, | |||
603 | spin_lock_irqsave(&dev->event_lock, flags); | 606 | spin_lock_irqsave(&dev->event_lock, flags); |
604 | 607 | ||
605 | if (file_priv->event_space < sizeof e->event) { | 608 | if (file_priv->event_space < sizeof e->event) { |
606 | spin_unlock_irqrestore(&dev->event_lock, flags); | 609 | ret = -EBUSY; |
607 | kfree(e); | 610 | goto err_unlock; |
608 | return -ENOMEM; | ||
609 | } | 611 | } |
610 | 612 | ||
611 | file_priv->event_space -= sizeof e->event; | 613 | file_priv->event_space -= sizeof e->event; |
@@ -638,6 +640,13 @@ static int drm_queue_vblank_event(struct drm_device *dev, int pipe, | |||
638 | spin_unlock_irqrestore(&dev->event_lock, flags); | 640 | spin_unlock_irqrestore(&dev->event_lock, flags); |
639 | 641 | ||
640 | return 0; | 642 | return 0; |
643 | |||
644 | err_unlock: | ||
645 | spin_unlock_irqrestore(&dev->event_lock, flags); | ||
646 | kfree(e); | ||
647 | err_put: | ||
648 | drm_vblank_put(dev, e->pipe); | ||
649 | return ret; | ||
641 | } | 650 | } |
642 | 651 | ||
643 | /** | 652 | /** |