Showing error 1056

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_0002.c
Line in file: 628
Project: Linux Kernel
Project version: 2.6.28
Tools: Undetermined 1
Entered: 2012-03-04 17:07:06 UTC


Source:

 598                /* It's harmless to issue the Erase-Suspend and Erase-Resume
 599                 * commands when the erase algorithm isn't in progress. */
 600                map_write(map, CMD(0xB0), chip->in_progress_block_addr);
 601                chip->oldstate = FL_ERASING;
 602                chip->state = FL_ERASE_SUSPENDING;
 603                chip->erase_suspended = 1;
 604                for (;;) {
 605                        if (chip_ready(map, adr))
 606                                break;
 607
 608                        if (time_after(jiffies, timeo)) {
 609                                /* Should have suspended the erase by now.
 610                                 * Send an Erase-Resume command as either
 611                                 * there was an error (so leave the erase
 612                                 * routine to recover from it) or we trying to
 613                                 * use the erase-in-progress sector. */
 614                                map_write(map, CMD(0x30), chip->in_progress_block_addr);
 615                                chip->state = FL_ERASING;
 616                                chip->oldstate = FL_READY;
 617                                printk(KERN_ERR "MTD %s(): chip not ready after erase suspend\n", __func__);
 618                                return -EIO;
 619                        }
 620
 621                        spin_unlock(chip->mutex);
 622                        cfi_udelay(1);
 623                        spin_lock(chip->mutex);
 624                        /* Nobody will touch it while it's in state FL_ERASE_SUSPENDING.
 625                           So we can just loop here. */
 626                }
 627                chip->state = FL_READY;
 628                return 0;
 629
 630        case FL_XIP_WHILE_ERASING:
 631                if (mode != FL_READY && mode != FL_POINT &&
 632                    (!cfip || !(cfip->EraseSuspend&2)))
 633                        goto sleep;
 634                chip->oldstate = chip->state;
 635                chip->state = FL_READY;
 636                return 0;
 637
 638        case FL_POINT:
Show full sources