Showing error 1243

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


Source:

402        struct devres *dr, *tmp;
403
404        cnt = remove_nodes(dev, first, end, &todo);
405
406        spin_unlock_irqrestore(&dev->devres_lock, flags);
407
408        /* Release.  Note that both devres and devres_group are
409         * handled as devres in the following loop.  This is safe.
410         */
411        list_for_each_entry_safe_reverse(dr, tmp, &todo, node.entry) {
412                devres_log(dev, &dr->node, "REL");
413                dr->node.release(dev, dr->data);
414                kfree(dr);
415        }
416
417        return cnt;
418}
419
420/**
421 * devres_release_all - Release all managed resources
422 * @dev: Device to release resources for
423 *
424 * Release all resources associated with @dev.  This function is
425 * called on driver detach.
426 */
427int devres_release_all(struct device *dev)
428{
429        unsigned long flags;
430
431        spin_lock_irqsave(&dev->devres_lock, flags);
432        return release_nodes(dev, dev->devres_head.next, &dev->devres_head,
433                             flags);
434}
435
436/**
437 * devres_open_group - Open a new devres group
438 * @dev: Device to open devres group for
439 * @id: Separator ID
440 * @gfp: Allocation flags
441 *
442 * Open a new devres group for @dev with @id.  For @id, using a
Show full sources