debugobjects: correct the usage of fixup call results
authorDu, Changbin <[email protected]>
Fri, 20 May 2016 00:09:23 +0000 (17:09 -0700)
committerLinus Torvalds <[email protected]>
Fri, 20 May 2016 02:12:14 +0000 (19:12 -0700)
If debug_object_fixup() return non-zero when problem has been fixed.
But the code got it backwards, it taks 0 as fixup successfully.  So fix
it.

Signed-off-by: Du, Changbin <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Cc: Josh Triplett <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
lib/debugobjects.c

index a9cee165cf2502143e54b6106e2951989f11b819..2f07c8c697b8ce5a0b672256f13d53ea21e475a6 100644 (file)
@@ -415,7 +415,7 @@ int debug_object_activate(void *addr, struct debug_obj_descr *descr)
                        state = obj->state;
                        raw_spin_unlock_irqrestore(&db->lock, flags);
                        ret = debug_object_fixup(descr->fixup_activate, addr, state);
-                       return ret ? -EINVAL : 0;
+                       return ret ? 0 : -EINVAL;
 
                case ODEBUG_STATE_DESTROYED:
                        debug_print_object(obj, "activate");