diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-09 19:07:38 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-09 19:07:38 +0300 |
commit | 18821b0408efc92ec2804128ba9382a3bcebf132 (patch) | |
tree | f98fbf75e8e8f33965e489879505fb621e2f11bb /drivers/char/agp | |
parent | 3b8ecd22447c4266500c0bcf97f035310543e494 (diff) | |
parent | 55e858c8483af427144f33b42b818b30612b82b0 (diff) | |
download | linux-18821b0408efc92ec2804128ba9382a3bcebf132.tar.xz |
Merge branch 'bkl-drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'bkl-drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
agp: Remove the BKL from agp_open
inifiband: Remove BKL from ipath_open()
mips: Remove BKL from tb0219
drivers: Remove BKL from scx200_gpio
drivers: Remove BKL from pc8736x_gpio
parisc: Remove BKL from eisa_eeprom
rtc: Remove BKL from efirtc
input: Remove BKL from hp_sdc_rtc
hw_random: Remove BKL from core
macintosh: Remove BKL from ans-lcd
nvram: Drop the bkl from non-generic nvram_llseek()
nvram: Drop the bkl from nvram_llseek()
mem_class: Drop the bkl from memory_open()
spi: Remove BKL from spidev_open
drivers: Remove BKL from cs5535_gpio
drivers: Remove BKL from misc_open
Diffstat (limited to 'drivers/char/agp')
-rw-r--r-- | drivers/char/agp/frontend.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/drivers/char/agp/frontend.c b/drivers/char/agp/frontend.c index a96f3197e60f..43412c03969e 100644 --- a/drivers/char/agp/frontend.c +++ b/drivers/char/agp/frontend.c @@ -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) { @@ -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; } |