Whamcloud - gitweb
LU-11424 lnet: copy the correct amount of cpts to lnet_cpts
[fs/lustre-release.git] / lnet / lnet / config.c
index 70240ad..ab314a3 100644 (file)
@@ -175,7 +175,7 @@ lnet_net_append_cpts(__u32 *cpts, __u32 ncpts, struct lnet_net *net)
                LIBCFS_ALLOC(net->net_cpts, sizeof(*net->net_cpts) * ncpts);
                if (net->net_cpts == NULL)
                        return -ENOMEM;
-               memcpy(net->net_cpts, cpts, ncpts);
+               memcpy(net->net_cpts, cpts, ncpts * sizeof(*net->net_cpts));
                net->net_ncpts = ncpts;
                return 0;
        }