Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173206
b: refs/heads/master
c: 55e858c
h: refs/heads/master
v: v3
  • Loading branch information
John Kacur authored and Thomas Gleixner committed Oct 14, 2009
1 parent 98319ed commit 337f9bc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 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: f96d3015e9f7f7fff4cab7ed1d467664cc980061
refs/heads/master: 55e858c8483af427144f33b42b818b30612b82b0
28 changes: 11 additions & 17 deletions trunk/drivers/char/agp/frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,25 +676,25 @@ static int agp_open(struct inode *inode, struct file *file)
int minor = iminor(inode);
struct agp_file_private *priv;
struct agp_client *client;
int rc = -ENXIO;

lock_kernel();
mutex_lock(&(agp_fe.agp_mutex));

if (minor != AGPGART_MINOR)
goto err_out;
return -ENXIO;

mutex_lock(&(agp_fe.agp_mutex));

priv = kzalloc(sizeof(struct agp_file_private), GFP_KERNEL);
if (priv == NULL)
goto err_out_nomem;
if (priv == NULL) {
mutex_unlock(&(agp_fe.agp_mutex));
return -ENOMEM;
}

set_bit(AGP_FF_ALLOW_CLIENT, &priv->access_flags);
priv->my_pid = current->pid;

if (capable(CAP_SYS_RAWIO)) {
if (capable(CAP_SYS_RAWIO))
/* Root priv, can be controller */
set_bit(AGP_FF_ALLOW_CONTROLLER, &priv->access_flags);
}

client = agp_find_client_by_pid(current->pid);

if (client != NULL) {
Expand All @@ -704,16 +704,10 @@ static int agp_open(struct inode *inode, struct file *file)
file->private_data = (void *) priv;
agp_insert_file_private(priv);
DBG("private=%p, client=%p", priv, client);
mutex_unlock(&(agp_fe.agp_mutex));
unlock_kernel();
return 0;

err_out_nomem:
rc = -ENOMEM;
err_out:
mutex_unlock(&(agp_fe.agp_mutex));
unlock_kernel();
return rc;

return 0;
}


Expand Down

0 comments on commit 337f9bc

Please sign in to comment.