Showing error 979

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/isicom.c
Line in file: 245
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-03-02 21:35:17 UTC


Source:

 215
 216/*
 217 *        Locking functions for card level locking. We need to own both
 218 *        the kernel lock for the card and have the card in a position that
 219 *        it wants to talk.
 220 */
 221
 222static inline int WaitTillCardIsFree(unsigned long base)
 223{
 224        unsigned int count = 0;
 225        unsigned int a = in_atomic(); /* do we run under spinlock? */
 226
 227        while (!(inw(base + 0xe) & 0x1) && count++ < 100)
 228                if (a)
 229                        mdelay(1);
 230                else
 231                        msleep(1);
 232
 233        return !(inw(base + 0xe) & 0x1);
 234}
 235
 236static int lock_card(struct isi_board *card)
 237{
 238        unsigned long base = card->base;
 239        unsigned int retries, a;
 240
 241        for (retries = 0; retries < 10; retries++) {
 242                spin_lock_irqsave(&card->card_lock, card->flags);
 243                for (a = 0; a < 10; a++) {
 244                        if (inw(base + 0xe) & 0x1)
 245                                return 1;
 246                        udelay(10);
 247                }
 248                spin_unlock_irqrestore(&card->card_lock, card->flags);
 249                msleep(10);
 250        }
 251        printk(KERN_WARNING "ISICOM: Failed to lock Card (0x%lx)\n",
 252                card->base);
 253
 254        return 0;        /* Failed to acquire the card! */
 255}
Show full sources