Showing error 919

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: 4347
Project: Linux Kernel
Project version: 2.6.28
Confirmation: Fixed by 87d75b52414a22c54cf8382bcdd329376b1bce78
Tools: Stanse (1.2)
Entered: 2012-03-02 21:35:17 UTC


Source:

4317}
4318
4319
4320static int cas_open(struct net_device *dev)
4321{
4322        struct cas *cp = netdev_priv(dev);
4323        int hw_was_up, err;
4324        unsigned long flags;
4325
4326        mutex_lock(&cp->pm_mutex);
4327
4328        hw_was_up = cp->hw_running;
4329
4330        /* The power-management mutex protects the hw_running
4331         * etc. state so it is safe to do this bit without cp->lock
4332         */
4333        if (!cp->hw_running) {
4334                /* Reset the chip */
4335                cas_lock_all_save(cp, flags);
4336                /* We set the second arg to cas_reset to zero
4337                 * because cas_init_hw below will have its second
4338                 * argument set to non-zero, which will force
4339                 * autonegotiation to start.
4340                 */
4341                cas_reset(cp, 0);
4342                cp->hw_running = 1;
4343                cas_unlock_all_restore(cp, flags);
4344        }
4345
4346        if (cas_tx_tiny_alloc(cp) < 0)
4347                return -ENOMEM;
4348
4349        /* alloc rx descriptors */
4350        err = -ENOMEM;
4351        if (cas_alloc_rxds(cp) < 0)
4352                goto err_tx_tiny;
4353
4354        /* allocate spares */
4355        cas_spare_init(cp);
4356        cas_spare_recover(cp, GFP_KERNEL);
4357
Show full sources