From 3cbed17e18b1d8611de49325084578260825db73 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=98yvind=20Harboe?= <oyvind.harboe@zylin.com>
Date: Sat, 7 Jan 2012 09:55:54 +0100
Subject: [PATCH] rtos: fix bug in error handling
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

checking for != ERROR_FAIL is broken.

Change-Id: Id7085afac653bb9c38d08928227a9ea402d8e6e9
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/351
Tested-by: jenkins
Reviewed-by: Michel JAOUEN <michel.jaouen@stericsson.com>
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
---
 src/server/gdb_server.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c
index 537513a1b..abec1383b 100644
--- a/src/server/gdb_server.c
+++ b/src/server/gdb_server.c
@@ -1039,8 +1039,8 @@ static int gdb_get_registers_packet(struct connection *connection,
 	LOG_DEBUG("-");
 #endif
 
-	if ( ( target->rtos != NULL ) &&
-		 ( ERROR_FAIL != rtos_get_gdb_reg_list( connection, &reg_list, &reg_list_size) ) )
+	if ((target->rtos != NULL) &&
+		(ERROR_OK == rtos_get_gdb_reg_list(connection, &reg_list, &reg_list_size)))
 	{
 		return ERROR_OK;
 	}