User: | Jiri Slaby |
Error type: | Leaving function in locked state |
Error type description: | Some lock is not unlocked on all paths of a function, so it is leaked |
File location: | drivers/mtd/chips/cfi_cmdset_0001.c |
Line in file: | 924 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Stanse
(1.2)
Undetermined 1 |
Entered: | 2012-03-02 21:35:17 UTC |
894 spin_unlock(contender->mutex); 895 goto retry; 896 } 897 spin_unlock(contender->mutex); 898 } 899 900 /* Check if we already have suspended erase 901 * on this chip. Sleep. */ 902 if (mode == FL_ERASING && shared->erasing 903 && shared->erasing->oldstate == FL_ERASING) { 904 spin_unlock(&shared->lock); 905 set_current_state(TASK_UNINTERRUPTIBLE); 906 add_wait_queue(&chip->wq, &wait); 907 spin_unlock(chip->mutex); 908 schedule(); 909 remove_wait_queue(&chip->wq, &wait); 910 spin_lock(chip->mutex); 911 goto retry; 912 } 913 914 /* We now own it */ 915 shared->writing = chip; 916 if (mode == FL_ERASING) 917 shared->erasing = chip; 918 spin_unlock(&shared->lock); 919 } 920 ret = chip_ready(map, chip, adr, mode); 921 if (ret == -EAGAIN) 922 goto retry; 923 924 return ret; 925} 926 927static void put_chip(struct map_info *map, struct flchip *chip, unsigned long adr) 928{ 929 struct cfi_private *cfi = map->fldrv_priv; 930 931 if (chip->priv) { 932 struct flchip_shared *shared = chip->priv; 933 spin_lock(&shared->lock); 934 if (shared->writing == chip && chip->oldstate == FL_READY) {