]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
nfp: tls: fix error return code in nfp_net_tls_add()
authorWei Yongjun <weiyongjun1@huawei.com>
Fri, 5 Jul 2019 08:26:25 +0000 (08:26 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Jul 2019 22:27:33 +0000 (15:27 -0700)
Fix to return negative error code -EINVAL from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 1f35a56cf586 ("nfp: tls: add/delete TLS TX connections")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/crypto/tls.c

index 3ee829d69c04327123c7945737de705fd1f5db45..9f7ccb7da4177e5b21028671bdbb549fba073888 100644 (file)
@@ -344,6 +344,7 @@ nfp_net_tls_add(struct net_device *netdev, struct sock *sk,
 
        if (!reply->handle[0] && !reply->handle[1]) {
                nn_dp_warn(&nn->dp, "FW returned NULL handle\n");
+               err = -EINVAL;
                goto err_fw_remove;
        }