Project

General

Profile

Bug #6134

fix result check in smp.c

Added by Richard PALO over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2015-08-18
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:

Description

From the code

178 static void
179 smp_cmd_failed(smp_result_t result)
180 {
181         char *smp_result_str = smp_get_result(result);
182 
183         if (result == 0) {
184                 fatal(-5, "Command failed: Unknown result (0x%x)",
185                     result);
186         } else {
187                 fatal(-5, "Command failed: %s", smp_result_str);
188         }
189 }

result == 0 is clearly an erroneous check, as smp_get_result() already treats correctly
SMP_RES_FUNCTION_ACCEPTED (0x00) as "Function accepted".

perhaps it should be SMP_RES_NONE or something else

Also available in: Atom PDF