Showing error 1054

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


Source:

 549        DECLARE_WAITQUEUE(wait, current);
 550        struct cfi_private *cfi = map->fldrv_priv;
 551        unsigned long timeo;
 552        struct cfi_pri_amdstd *cfip = (struct cfi_pri_amdstd *)cfi->cmdset_priv;
 553
 554 resettime:
 555        timeo = jiffies + HZ;
 556 retry:
 557        switch (chip->state) {
 558
 559        case FL_STATUS:
 560                for (;;) {
 561                        if (chip_ready(map, adr))
 562                                break;
 563
 564                        if (time_after(jiffies, timeo)) {
 565                                printk(KERN_ERR "Waiting for chip to be ready timed out.\n");
 566                                spin_unlock(chip->mutex);
 567                                return -EIO;
 568                        }
 569                        spin_unlock(chip->mutex);
 570                        cfi_udelay(1);
 571                        spin_lock(chip->mutex);
 572                        /* Someone else might have been playing with it. */
 573                        goto retry;
 574                }
 575
 576        case FL_READY:
 577        case FL_CFI_QUERY:
 578        case FL_JEDEC_QUERY:
 579                return 0;
 580
 581        case FL_ERASING:
 582                if (mode == FL_WRITING) /* FIXME: Erase-suspend-program appears broken. */
 583                        goto sleep;
 584
 585                if (!(   mode == FL_READY
 586                      || mode == FL_POINT
 587                      || !cfip
 588                      || (mode == FL_WRITING && (cfip->EraseSuspend & 0x2))
 589                      || (mode == FL_WRITING && (cfip->EraseSuspend & 0x1)
Show full sources