Skip to content
Commit 8c3b8dc5 authored by liuyacan's avatar liuyacan Committed by David S. Miller
Browse files

net/smc: fix listen processing for SMC-Rv2

In the process of checking whether RDMAv2 is available, the current
implementation first sets ini->smcrv2.ib_dev_v2, and then allocates
smc buf desc, but the latter may fail. Unfortunately, the caller
will only check the former. In this case, a NULL pointer reference
will occur in smc_clc_send_confirm_accept() when accessing
conn->rmb_desc.

This patch does two things:
1. Use the return code to determine whether V2 is available.
2. If the return code is NODEV, continue to check whether V1 is
available.

Fixes: e49300a6

 ("net/smc: add listen processing for SMC-Rv2")
Signed-off-by: default avatarliuyacan <liuyacan@corp.netease.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 75c1edf2
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment