diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-09 11:07:38 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-09 11:07:38 -0500 |
commit | 18821b0408efc92ec2804128ba9382a3bcebf132 (patch) | |
tree | f98fbf75e8e8f33965e489879505fb621e2f11bb /drivers/char/agp | |
parent | 3b8ecd22447c4266500c0bcf97f035310543e494 (diff) | |
parent | 55e858c8483af427144f33b42b818b30612b82b0 (diff) |
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) | |||
676 | int minor = iminor(inode); | 676 | int minor = iminor(inode); |
677 | struct agp_file_private *priv; | 677 | struct agp_file_private *priv; |
678 | struct agp_client *client; | 678 | struct agp_client *client; |
679 | int rc = -ENXIO; | ||
680 | |||
681 | lock_kernel(); | ||
682 | mutex_lock(&(agp_fe.agp_mutex)); | ||
683 | 679 | ||
684 | if (minor != AGPGART_MINOR) | 680 | if (minor != AGPGART_MINOR) |
685 | goto err_out; | 681 | return -ENXIO; |
682 | |||
683 | mutex_lock(&(agp_fe.agp_mutex)); | ||
686 | 684 | ||
687 | priv = kzalloc(sizeof(struct agp_file_private), GFP_KERNEL); | 685 | priv = kzalloc(sizeof(struct agp_file_private), GFP_KERNEL); |
688 | if (priv == NULL) | 686 | if (priv == NULL) { |
689 | goto err_out_nomem; | 687 | mutex_unlock(&(agp_fe.agp_mutex)); |
688 | return -ENOMEM; | ||
689 | } | ||
690 | 690 | ||
691 | set_bit(AGP_FF_ALLOW_CLIENT, &priv->access_flags); | 691 | set_bit(AGP_FF_ALLOW_CLIENT, &priv->access_flags); |
692 | priv->my_pid = current->pid; | 692 | priv->my_pid = current->pid; |
693 | 693 | ||
694 | if (capable(CAP_SYS_RAWIO)) { | 694 | if (capable(CAP_SYS_RAWIO)) |
695 | /* Root priv, can be controller */ | 695 | /* Root priv, can be controller */ |
696 | set_bit(AGP_FF_ALLOW_CONTROLLER, &priv->access_flags); | 696 | set_bit(AGP_FF_ALLOW_CONTROLLER, &priv->access_flags); |
697 | } | 697 | |
698 | client = agp_find_client_by_pid(current->pid); | 698 | client = agp_find_client_by_pid(current->pid); |
699 | 699 | ||
700 | if (client != NULL) { | 700 | if (client != NULL) { |
@@ -704,16 +704,10 @@ static int agp_open(struct inode *inode, struct file *file) | |||
704 | file->private_data = (void *) priv; | 704 | file->private_data = (void *) priv; |
705 | agp_insert_file_private(priv); | 705 | agp_insert_file_private(priv); |
706 | DBG("private=%p, client=%p", priv, client); | 706 | DBG("private=%p, client=%p", priv, client); |
707 | mutex_unlock(&(agp_fe.agp_mutex)); | ||
708 | unlock_kernel(); | ||
709 | return 0; | ||
710 | 707 | ||
711 | err_out_nomem: | ||
712 | rc = -ENOMEM; | ||
713 | err_out: | ||
714 | mutex_unlock(&(agp_fe.agp_mutex)); | 708 | mutex_unlock(&(agp_fe.agp_mutex)); |
715 | unlock_kernel(); | 709 | |
716 | return rc; | 710 | return 0; |
717 | } | 711 | } |
718 | 712 | ||
719 | 713 | ||