Showing error 1287

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


Source:

 233        BMCR_SPEED100,                         /* 2 : 100bt half duplex */
 234        BMCR_FULLDPLX,                         /* 3 : 10bt full duplex */
 235        BMCR_SPEED100|BMCR_FULLDPLX,         /* 4 : 100bt full duplex */
 236        CAS_BMCR_SPEED1000|BMCR_FULLDPLX /* 5 : 1000bt full duplex */
 237};
 238
 239static struct pci_device_id cas_pci_tbl[] __devinitdata = {
 240        { PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_CASSINI,
 241          PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
 242        { PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SATURN,
 243          PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
 244        { 0, }
 245};
 246
 247MODULE_DEVICE_TABLE(pci, cas_pci_tbl);
 248
 249static void cas_set_link_modes(struct cas *cp);
 250
 251static inline void cas_lock_tx(struct cas *cp)
 252{
 253        int i;
 254
 255        for (i = 0; i < N_TX_RINGS; i++)
 256                spin_lock(&cp->tx_lock[i]);
 257}
 258
 259static inline void cas_lock_all(struct cas *cp)
 260{
 261        spin_lock_irq(&cp->lock);
 262        cas_lock_tx(cp);
 263}
 264
 265/* WTZ: QA was finding deadlock problems with the previous
 266 * versions after long test runs with multiple cards per machine.
 267 * See if replacing cas_lock_all with safer versions helps. The
 268 * symptoms QA is reporting match those we'd expect if interrupts
 269 * aren't being properly restored, and we fixed a previous deadlock
 270 * with similar symptoms by using save/restore versions in other
 271 * places.
 272 */
 273#define cas_lock_all_save(cp, flags) \
Show full sources