@@ -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;
}
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(+)