Commit db1e7806 authored by NeilBrown's avatar NeilBrown Committed by Greg Kroah-Hartman
Browse files

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: default avatarNeilBrown <neilb@suse.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 33be4600
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -884,8 +884,7 @@ lnet_destroy_rc_data(struct lnet_rc_data *rcd)
		lnet_net_unlock(cpt);
		lnet_net_unlock(cpt);
	}
	}


	if (rcd->rcd_pinginfo)
	kfree(rcd->rcd_pinginfo);
		LIBCFS_FREE(rcd->rcd_pinginfo, LNET_PINGINFO_SIZE);


	kfree(rcd);
	kfree(rcd);
}
}
@@ -908,7 +907,7 @@ lnet_create_rc_data_locked(struct lnet_peer *gateway)
	LNetInvalidateMDHandle(&rcd->rcd_mdh);
	LNetInvalidateMDHandle(&rcd->rcd_mdh);
	INIT_LIST_HEAD(&rcd->rcd_list);
	INIT_LIST_HEAD(&rcd->rcd_list);


	LIBCFS_ALLOC(pi, LNET_PINGINFO_SIZE);
	pi = kzalloc(LNET_PINGINFO_SIZE, GFP_NOFS);
	if (!pi)
	if (!pi)
		goto out;
		goto out;