From: Vladimir Saveliev Date: Wed, 10 Jul 2024 09:26:17 +0000 (+0300) Subject: LU-18016 kfilnd: avoid wrong call to kfilnd_ep_put_key X-Git-Tag: 2.15.90~82 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=db5aa4b3800e807ea353743c594bd917292dc8ed;p=fs%2Flustre-release.git LU-18016 kfilnd: avoid wrong call to kfilnd_ep_put_key kfilnd_tn_alloc(): do not call kfilnd_ep_put_key() if kfilnd_ep_get_key() was not called HPE-bug-id: LUS-12405 Test-Parameters: trivial Signed-off-by: Vladimir Saveliev Change-Id: I6dc9f581b5632a9a220cc04f4b5735581b75f40a Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55688 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Chris Horn Reviewed-by: Alexander Boyko Reviewed-by: Oleg Drokin --- diff --git a/lnet/klnds/kfilnd/kfilnd_tn.c b/lnet/klnds/kfilnd/kfilnd_tn.c index 60fc54e..68ff4ee 100644 --- a/lnet/klnds/kfilnd/kfilnd_tn.c +++ b/lnet/klnds/kfilnd/kfilnd_tn.c @@ -1700,7 +1700,8 @@ struct kfilnd_transaction *kfilnd_tn_alloc(struct kfilnd_dev *dev, int cpt, return tn; err_put_key: - kfilnd_ep_put_key(ep, key); + if (need_key) + kfilnd_ep_put_key(ep, key); err: return ERR_PTR(rc); }