Skip to content

Commit

Permalink
staging/lustre/lnet: Fix allocation size for sv_cpt_data
Browse files Browse the repository at this point in the history
This is unbreaking another of those "stealth" janitor
patches that got in and subtly broke some things.

sv_cpt_data is a pointer to pointer, so need to
dereference it twice to allocate the correct structure size.

Fixes: 9899cb6 ("Staging: lustre: rpc: Use sizeof type *pointer instead of sizeof type.")
CC: Sandhya Bankar <bankarsandhya512@gmail.com>
Cc: stable <stable@vger.kernel.org> # 4.7+
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Oleg Drokin authored and Greg Kroah-Hartman committed Feb 26, 2017
1 parent 7aa2a92 commit dc7ffef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lnet/selftest/rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ srpc_service_init(struct srpc_service *svc)
svc->sv_shuttingdown = 0;

svc->sv_cpt_data = cfs_percpt_alloc(lnet_cpt_table(),
sizeof(*svc->sv_cpt_data));
sizeof(**svc->sv_cpt_data));
if (!svc->sv_cpt_data)
return -ENOMEM;

Expand Down

0 comments on commit dc7ffef

Please sign in to comment.