Skip to content

Commit

Permalink
kmemleak: fix sparse warning over overshadowed flags
Browse files Browse the repository at this point in the history
A secondary irq_save is not required as a locking before it was
already disabling irqs.

This fixes this sparse warning:
mm/kmemleak.c:512:31: warning: symbol 'flags' shadows an earlier one
mm/kmemleak.c:448:23: originally declared here

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
  • Loading branch information
Luis R. Rodriguez authored and Catalin Marinas committed Sep 8, 2009
1 parent a1084c8 commit 0580a18
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mm/kmemleak.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ static struct kmemleak_object *create_object(unsigned long ptr, size_t size,
object->tree_node.last = ptr + size - 1;

write_lock_irqsave(&kmemleak_lock, flags);

min_addr = min(min_addr, ptr);
max_addr = max(max_addr, ptr + size);
node = prio_tree_insert(&object_tree_root, &object->tree_node);
Expand All @@ -565,14 +566,12 @@ static struct kmemleak_object *create_object(unsigned long ptr, size_t size,
* random memory blocks.
*/
if (node != &object->tree_node) {
unsigned long flags;

kmemleak_stop("Cannot insert 0x%lx into the object search tree "
"(already existing)\n", ptr);
object = lookup_object(ptr, 1);
spin_lock_irqsave(&object->lock, flags);
spin_lock(&object->lock);
dump_object_info(object);
spin_unlock_irqrestore(&object->lock, flags);
spin_unlock(&object->lock);

goto out;
}
Expand Down

0 comments on commit 0580a18

Please sign in to comment.