Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754024AbcDVIWD (ORCPT ); Fri, 22 Apr 2016 04:22:03 -0400 Received: from mga04.intel.com ([192.55.52.120]:64052 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751978AbcDVITP (ORCPT ); Fri, 22 Apr 2016 04:19:15 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,516,1455004800"; d="scan'208";a="89859988" From: changbin.du@intel.com To: akpm@linux-foundation.org Cc: corbet@lwn.net, paulmck@linux.vnet.ibm.com, josh@joshtriplett.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, tglx@linutronix.de, john.stultz@linaro.org, tj@kernel.org, borntraeger@de.ibm.com, dchinner@redhat.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, "Du, Changbin" , Du@vger.kernel.org Subject: [PATCH 2/7] debugobjects: correct the usage of fixup call results Date: Fri, 22 Apr 2016 16:07:43 +0800 Message-Id: <1461312468-14335-3-git-send-email-changbin.du@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1461312468-14335-1-git-send-email-changbin.du@intel.com> References: <1461312468-14335-1-git-send-email-changbin.du@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 829 Lines: 26 From: "Du, Changbin" 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 --- lib/debugobjects.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/debugobjects.c b/lib/debugobjects.c index a9cee16..2f07c8c 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c @@ -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"); -- 2.7.4