git.droids-corp.org
/
dpdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cafba10
)
net/mrvl: reset errno before library call
author
Tomasz Duszynski
<tdu@semihalf.com>
Thu, 2 Nov 2017 08:37:25 +0000
(09:37 +0100)
committer
Ferruh Yigit
<ferruh.yigit@intel.com>
Thu, 2 Nov 2017 18:42:11 +0000
(19:42 +0100)
In case errno contains some non-zero value and call to strtoul() is
successful -2 error will be returned.
Setting errno to zero before calling strtoul() makes sure
errors will be handled correctly.
Fixes:
0ddc9b815b11
("net/mrvl: add net PMD skeleton")
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
drivers/net/mrvl/mrvl_qos.c
patch
|
blob
|
history
diff --git
a/drivers/net/mrvl/mrvl_qos.c
b/drivers/net/mrvl/mrvl_qos.c
index
54e682a
..
7c9943a
100644
(file)
--- a/
drivers/net/mrvl/mrvl_qos.c
+++ b/
drivers/net/mrvl/mrvl_qos.c
@@
-99,6
+99,7
@@
get_val_securely(const char *string, uint32_t *val)
if (len == 0)
return -1;
+ errno = 0;
*val = strtoul(string, &endptr, 0);
if (errno != 0 || RTE_PTR_DIFF(endptr, string) != len)
return -2;