A previous patch fixed one of three memcpy() calls in
lnet_net_append_cpts() to copy the correct number of bytes.
This patch fixes the other two.
Test-Parameters: trivial testlist=sanity-lnet
Fixes:
8cbb8cd3e771 ("LU-7734 lnet: Multi-Rail local NI split")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I5a3450b0043c60b6c432db5be47f1e27ecc1fc94
Reviewed-on: https://review.whamcloud.com/36636
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
goto failed;
}
- memcpy(array, net->net_cpts, net->net_ncpts);
+ memcpy(array, net->net_cpts,
+ net->net_ncpts * sizeof(*net->net_cpts));
loc = array + net->net_ncpts;
- memcpy(loc, added_cpts, j);
+ memcpy(loc, added_cpts, j * sizeof(*net->net_cpts));
LIBCFS_FREE(net->net_cpts, sizeof(*net->net_cpts) *
net->net_ncpts);