diff mbox series

[-next] cxgb4/chcr: Fix error return code in chcr_ktls_dev_add()

Message ID 20200509080548.118667-1-weiyongjun1@huawei.com (mailing list archive)
State Not Applicable
Delegated to: Herbert Xu
Headers show
Series [-next] cxgb4/chcr: Fix error return code in chcr_ktls_dev_add() | expand

Commit Message

Wei Yongjun May 9, 2020, 8:05 a.m. UTC
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 mbox series

Patch

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;
 	}