Showing error 1261

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/char/pcmcia/cm4000_cs.c
Line in file: 1578
Project: Linux Kernel
Project version: 2.6.28
Confirmation: Fixed by 69ae59d7d8df14413cf0a97b3e372d7dc8352563
Tools: Stanse (1.2)
Entered: 2012-05-21 20:30:05 UTC


Source:

1548                                  == 0)))) {
1549                                if (filp->f_flags & O_NONBLOCK)
1550                                        rc = -EAGAIN;
1551                                else
1552                                        rc = -ERESTARTSYS;
1553                                break;
1554                        }
1555                        /* Set Flags0 = 0x42 */
1556                        DEBUGP(4, dev, "Set Flags0=0x42 \n");
1557                        xoutb(0x42, REG_FLAGS0(iobase));
1558                        clear_bit(IS_ATR_PRESENT, &dev->flags);
1559                        clear_bit(IS_ATR_VALID, &dev->flags);
1560                        dev->mstate = M_CARDOFF;
1561                        clear_bit(LOCK_IO, &dev->flags);
1562                        if (wait_event_interruptible
1563                            (dev->atrq,
1564                             ((filp->f_flags & O_NONBLOCK)
1565                              || (test_bit(IS_ATR_VALID, (void *)&dev->flags) !=
1566                                  0)))) {
1567                                if (filp->f_flags & O_NONBLOCK)
1568                                        rc = -EAGAIN;
1569                                else
1570                                        rc = -ERESTARTSYS;
1571                                break;
1572                        }
1573                }
1574                /* release lock */
1575                clear_bit(LOCK_IO, &dev->flags);
1576                wake_up_interruptible(&dev->ioq);
1577
1578                return 0;
1579        case CM_IOCSPTS:
1580                {
1581                        struct ptsreq krnptsreq;
1582
1583                        if (copy_from_user(&krnptsreq, argp,
1584                                           sizeof(struct ptsreq))) {
1585                                rc = -EFAULT;
1586                                break;
1587                        }
1588
Show full sources