Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359339
b: refs/heads/master
c: cc39a8f
h: refs/heads/master
i:
  359337: 783427a
  359335: fb38a63
v: v3
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed Feb 28, 2013
1 parent ff874ce commit bbb4dc2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 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: 36888db24765478a463ac6f443b175ad885dee25
refs/heads/master: cc39a8faedc936df90cac077b2da6f420a777259
17 changes: 8 additions & 9 deletions trunk/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,16 @@ int vmw_resource_alloc_id(struct vmw_resource *res)

BUG_ON(res->id != -1);

do {
if (unlikely(idr_pre_get(idr, GFP_KERNEL) == 0))
return -ENOMEM;

write_lock(&dev_priv->resource_lock);
ret = idr_get_new_above(idr, res, 1, &res->id);
write_unlock(&dev_priv->resource_lock);
idr_preload(GFP_KERNEL);
write_lock(&dev_priv->resource_lock);

} while (ret == -EAGAIN);
ret = idr_alloc(idr, res, 1, 0, GFP_NOWAIT);
if (ret >= 0)
res->id = ret;

return ret;
write_unlock(&dev_priv->resource_lock);
idr_preload_end();
return ret < 0 ? ret : 0;
}

/**
Expand Down

0 comments on commit bbb4dc2

Please sign in to comment.