diff options
author | NeilBrown <neilb@suse.com> | 2018-01-08 20:19:38 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-01-09 09:41:57 -0500 |
commit | db1e7806d39ec0d6486aa7114e9d0a3a4e7f3399 (patch) | |
tree | 60e17725b6eab81c6ae60f7452859d8db0774c6d | |
parent | 33be4600f0d1ffb9e58f752bb987f0ca15909f76 (diff) |
staging: lustre: lnet-route: use kmalloc for small allocation
This allocation is reasonably small.
As the function is called "*_locked", it might not be safe
to perform a GFP_KERNEL allocation, so be safe and
use GFP_NOFS.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/lustre/lnet/lnet/router.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c index 409244e57a31..476d6d296037 100644 --- a/drivers/staging/lustre/lnet/lnet/router.c +++ b/drivers/staging/lustre/lnet/lnet/router.c | |||
@@ -884,8 +884,7 @@ lnet_destroy_rc_data(struct lnet_rc_data *rcd) | |||
884 | lnet_net_unlock(cpt); | 884 | lnet_net_unlock(cpt); |
885 | } | 885 | } |
886 | 886 | ||
887 | if (rcd->rcd_pinginfo) | 887 | kfree(rcd->rcd_pinginfo); |
888 | LIBCFS_FREE(rcd->rcd_pinginfo, LNET_PINGINFO_SIZE); | ||
889 | 888 | ||
890 | kfree(rcd); | 889 | kfree(rcd); |
891 | } | 890 | } |
@@ -908,7 +907,7 @@ lnet_create_rc_data_locked(struct lnet_peer *gateway) | |||
908 | LNetInvalidateMDHandle(&rcd->rcd_mdh); | 907 | LNetInvalidateMDHandle(&rcd->rcd_mdh); |
909 | INIT_LIST_HEAD(&rcd->rcd_list); | 908 | INIT_LIST_HEAD(&rcd->rcd_list); |
910 | 909 | ||
911 | LIBCFS_ALLOC(pi, LNET_PINGINFO_SIZE); | 910 | pi = kzalloc(LNET_PINGINFO_SIZE, GFP_NOFS); |
912 | if (!pi) | 911 | if (!pi) |
913 | goto out; | 912 | goto out; |
914 | 913 | ||