staging: lustre: lnet: memory corruption in selftest
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 24 Nov 2016 11:10:39 +0000 (14:10 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Nov 2016 20:44:01 +0000 (21:44 +0100)
We want sizeof(struct lstcon_node) but instead we're getting the sizeof
a pointer.

Fixes: 8d78f0f2ba76 ("staging: lustre: lnet: cleanup some of the > 80 line issues")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lnet/selftest/console.c

index f2d11fac5bd895cc0b5ad252252374c485420ea3..f750b9cb0441e578f1873a1eaf610f2d6f14a2cd 100644 (file)
@@ -86,7 +86,7 @@ lstcon_node_find(lnet_process_id_t id, struct lstcon_node **ndpp, int create)
        if (!create)
                return -ENOENT;
 
-       LIBCFS_ALLOC(*ndpp, sizeof(*ndpp) + sizeof(*ndl));
+       LIBCFS_ALLOC(*ndpp, sizeof(**ndpp) + sizeof(*ndl));
        if (!*ndpp)
                return -ENOMEM;