[PATCH 5.8 033/633] chelsio/chtls: correct netdevice for vlan interface

From: Greg Kroah-Hartman
Date: Tue Oct 27 2020 - 10:49:12 EST


From: Vinay Kumar Yadav <vinay.yadav@xxxxxxxxxxx>

[ Upstream commit 81519d1f7df7ed1bd5b1397540c8884438f57ae2 ]

Check if netdevice is a vlan interface and find real vlan netdevice.

Fixes: cc35c88ae4db ("crypto : chtls - CPL handler definition")
Signed-off-by: Venkatesh Ellapu <venkatesh.e@xxxxxxxxxxx>
Signed-off-by: Vinay Kumar Yadav <vinay.yadav@xxxxxxxxxxx>
Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
drivers/crypto/chelsio/chtls/chtls_cm.c | 3 +++
1 file changed, 3 insertions(+)

--- a/drivers/crypto/chelsio/chtls/chtls_cm.c
+++ b/drivers/crypto/chelsio/chtls/chtls_cm.c
@@ -1156,6 +1156,9 @@ static struct sock *chtls_recv_sock(stru
ndev = n->dev;
if (!ndev)
goto free_dst;
+ if (is_vlan_dev(ndev))
+ ndev = vlan_dev_real_dev(ndev);
+
port_id = cxgb4_port_idx(ndev);

csk = chtls_sock_create(cdev);