Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223022
b: refs/heads/master
c: ea5d552
h: refs/heads/master
v: v3
  • Loading branch information
Chris Wilson authored and Dave Airlie committed Dec 7, 2010
1 parent e27947e commit c8d597c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e516c7df4cfe335a2ea220480cfac558dc738ae4
refs/heads/master: ea5d552c73707645c53d42e8a71c9a4d9cbb85c1
19 changes: 14 additions & 5 deletions trunk/drivers/gpu/drm/drm_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,10 +585,13 @@ static int drm_queue_vblank_event(struct drm_device *dev, int pipe,
struct timeval now;
unsigned long flags;
unsigned int seq;
int ret;

e = kzalloc(sizeof *e, GFP_KERNEL);
if (e == NULL)
return -ENOMEM;
if (e == NULL) {
ret = -ENOMEM;
goto err_put;
}

e->pipe = pipe;
e->base.pid = current->pid;
Expand All @@ -603,9 +606,8 @@ static int drm_queue_vblank_event(struct drm_device *dev, int pipe,
spin_lock_irqsave(&dev->event_lock, flags);

if (file_priv->event_space < sizeof e->event) {
spin_unlock_irqrestore(&dev->event_lock, flags);
kfree(e);
return -ENOMEM;
ret = -EBUSY;
goto err_unlock;
}

file_priv->event_space -= sizeof e->event;
Expand Down Expand Up @@ -638,6 +640,13 @@ static int drm_queue_vblank_event(struct drm_device *dev, int pipe,
spin_unlock_irqrestore(&dev->event_lock, flags);

return 0;

err_unlock:
spin_unlock_irqrestore(&dev->event_lock, flags);
kfree(e);
err_put:
drm_vblank_put(dev, e->pipe);
return ret;
}

/**
Expand Down

0 comments on commit c8d597c

Please sign in to comment.