Showing error 1058

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: 1249
Project: Linux Kernel
Project version: 2.6.28
Tools: Undetermined 1
Entered: 2012-03-04 17:07:06 UTC


Source:

1219                        msleep(sleep_time/1000);
1220                        timeo -= sleep_time;
1221                        sleep_time = 1000000/HZ;
1222                } else {
1223                        udelay(1);
1224                        cond_resched();
1225                        timeo--;
1226                }
1227                spin_lock(chip->mutex);
1228
1229                while (chip->state != chip_state) {
1230                        /* Someone's suspended the operation: sleep */
1231                        DECLARE_WAITQUEUE(wait, current);
1232                        set_current_state(TASK_UNINTERRUPTIBLE);
1233                        add_wait_queue(&chip->wq, &wait);
1234                        spin_unlock(chip->mutex);
1235                        schedule();
1236                        remove_wait_queue(&chip->wq, &wait);
1237                        spin_lock(chip->mutex);
1238                }
1239                if (chip->erase_suspended || chip->write_suspended)  {
1240                        /* Suspend has occured while sleep: reset timeout */
1241                        timeo = reset_timeo;
1242                        chip->erase_suspended = 0;
1243                        chip->write_suspended = 0;
1244                }
1245        }
1246
1247        /* Done and happy. */
1248         chip->state = FL_STATUS;
1249        return 0;
1250}
1251
1252#endif
1253
1254#define WAIT_TIMEOUT(map, chip, adr, udelay, udelay_max) \
1255        INVAL_CACHE_AND_WAIT(map, chip, adr, 0, 0, udelay, udelay_max);
1256
1257
1258static int do_point_onechip (struct map_info *map, struct flchip *chip, loff_t adr, size_t len)
1259{
Show full sources