public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] cxgb4/chcr: Fix error return code in chcr_ktls_dev_add()
@ 2020-05-09  8:05 Wei Yongjun
  2020-05-12  8:04 ` [PATCH] cxgb4/chcr: Fix a leak " Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2020-05-09  8:05 UTC (permalink / raw)
  To: Ayush Sawal, Vinay Kumar Yadav, Rohit Maheshwari, Herbert Xu
  Cc: Wei Yongjun, linux-crypto, kernel-janitors, Hulk Robot

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 34aba2c45024 ("cxgb4/chcr : Register to tls add and del callback")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/crypto/chelsio/chcr_ktls.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/crypto/chelsio/chcr_ktls.c b/drivers/crypto/chelsio/chcr_ktls.c
index 43d9e2420110..baaea8ce4080 100644
--- a/drivers/crypto/chelsio/chcr_ktls.c
+++ b/drivers/crypto/chelsio/chcr_ktls.c
@@ -501,12 +501,14 @@ static int chcr_ktls_dev_add(struct net_device *netdev, struct sock *sk,
 	dst = sk_dst_get(sk);
 	if (!dst) {
 		pr_err("DST entry not found\n");
+		ret = -ENOENT;
 		goto out2;
 	}
 	n = dst_neigh_lookup(dst, daaddr);
 	if (!n || !n->dev) {
 		pr_err("neighbour not found\n");
 		dst_release(dst);
+		ret = -ENOENT;
 		goto out2;
 	}
 	tx_info->l2te  = cxgb4_l2t_get(adap->l2t, n, n->dev, 0);
@@ -516,6 +518,7 @@ static int chcr_ktls_dev_add(struct net_device *netdev, struct sock *sk,
 
 	if (!tx_info->l2te) {
 		pr_err("l2t entry not found\n");
+		ret = -ENOENT;
 		goto out2;
 	}




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-12  8:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-09  8:05 [PATCH -next] cxgb4/chcr: Fix error return code in chcr_ktls_dev_add() Wei Yongjun
2020-05-12  8:04 ` [PATCH] cxgb4/chcr: Fix a leak " Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox