Commit 1d5b8d01 authored by Bongsu Jeon's avatar Bongsu Jeon Committed by David S. Miller
Browse files

selftests: nci: Fix the wrong condition



memcpy should be executed only in case nla_len's value is greater than 0.

Signed-off-by: default avatarBongsu Jeon <bongsu.jeon@samsung.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 78a7b2a8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;