Showing error 1303

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/net/wan/sbni.c
Line in file: 527
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-05-21 20:30:05 UTC


Source:

 497 * While next board driver is initialized, it scans this list. If one
 498 * has found dev with same irq and ioaddr different by 4 then it assumes
 499 * this board to be "master".
 500 */ 
 501
 502static irqreturn_t
 503sbni_interrupt( int  irq,  void  *dev_id )
 504{
 505        struct net_device          *dev = dev_id;
 506        struct net_local  *nl  = dev->priv;
 507        int        repeat;
 508
 509        spin_lock( &nl->lock );
 510        if( nl->second )
 511                spin_lock( &((struct net_local *) nl->second->priv)->lock );
 512
 513        do {
 514                repeat = 0;
 515                if( inb( dev->base_addr + CSR0 ) & (RC_RDY | TR_RDY) )
 516                        handle_channel( dev ),
 517                        repeat = 1;
 518                if( nl->second  &&         /* second channel present */
 519                    (inb( nl->second->base_addr+CSR0 ) & (RC_RDY | TR_RDY)) )
 520                        handle_channel( nl->second ),
 521                        repeat = 1;
 522        } while( repeat );
 523
 524        if( nl->second )
 525                spin_unlock( &((struct net_local *)nl->second->priv)->lock );
 526        spin_unlock( &nl->lock );
 527        return IRQ_HANDLED;
 528}
 529
 530
 531static void
 532handle_channel( struct net_device  *dev )
 533{
 534        struct net_local        *nl    = (struct net_local *) dev->priv;
 535        unsigned long                ioaddr = dev->base_addr;
 536
 537        int  req_ans;
Show full sources