staging: lustre: lnet: memory corruption in selftest
Subsystems (2)
PATCH 1/1 staging: lustre: lnet: memory corruption in selftest
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 <[email protected]>
drivers/staging/lustre/lnet/selftest/console.c +1 -1
@@ -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 ;
Quoted 6 lines · Dan Carpenter
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 <[email protected]>
Reviewed-by Andreas Dilger <[email protected]>
Quoted 14 lines
drivers/staging/lustre/lnet/selftest/console.c +1
-1@@ -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 ;