Skip to content
Snippets Groups Projects
Commit 7a0ad2cc authored by Joe Hershberger's avatar Joe Hershberger Committed by Tom Rini
Browse files

env: Fix return values in env_attr_lookup()


This function returned numbers for error codes. Change them to error
codes.

Signed-off-by: default avatarJoe Hershberger <joe.hershberger@ni.com>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
parent 7acdf781
No related branches found
No related tags found
No related merge requests found
......@@ -148,10 +148,10 @@ int env_attr_lookup(const char *attr_list, const char *name, char *attributes)
if (!attributes)
/* bad parameter */
return -1;
return -EINVAL;
if (!attr_list)
/* list not found */
return 1;
return -EINVAL;
entry = reverse_strstr(attr_list, name, NULL);
while (entry != NULL) {
......@@ -209,5 +209,5 @@ int env_attr_lookup(const char *attr_list, const char *name, char *attributes)
}
/* not found in list */
return 2;
return -ENOENT;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment