projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
78a7b2a
)
selftests: nci: Fix the wrong condition
author
Bongsu Jeon
<bongsu.jeon@samsung.com>
Tue, 17 Aug 2021 13:28:15 +0000
(06:28 -0700)
committer
David S. Miller
<davem@davemloft.net>
Wed, 18 Aug 2021 09:17:57 +0000
(10:17 +0100)
memcpy should be executed only in case nla_len's value is greater than 0.
Signed-off-by: Bongsu Jeon <bongsu.jeon@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/nci/nci_dev.c
patch
|
blob
|
history
diff --git
a/tools/testing/selftests/nci/nci_dev.c
b/tools/testing/selftests/nci/nci_dev.c
index
cf47505
..
a1786ce
100644
(file)
--- a/
tools/testing/selftests/nci/nci_dev.c
+++ b/
tools/testing/selftests/nci/nci_dev.c
@@
-110,7
+110,7
@@
static int send_cmd_mt_nla(int sd, __u16 nlmsg_type, __u32 nlmsg_pid,
na->nla_type = nla_type[cnt];
na->nla_len = nla_len[cnt] + NLA_HDRLEN;
- if (nla_len > 0)
+ if (nla_len
[cnt]
> 0)
memcpy(NLA_DATA(na), nla_data[cnt], nla_len[cnt]);
prv_len = NLA_ALIGN(nla_len[cnt]) + NLA_HDRLEN;