Commit 8c3b8dc
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: e49300a ("net/smc: add listen processing for SMC-Rv2")
Signed-off-by: liuyacan <liuyacan@corp.netease.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent 75c1edf commit 8c3b8dc
1 file changed
Lines changed: 27 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2093 | 2093 | | |
2094 | 2094 | | |
2095 | 2095 | | |
2096 | | - | |
2097 | | - | |
2098 | | - | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
2099 | 2099 | | |
2100 | 2100 | | |
2101 | 2101 | | |
2102 | | - | |
| 2102 | + | |
2103 | 2103 | | |
2104 | 2104 | | |
2105 | 2105 | | |
| |||
2117 | 2117 | | |
2118 | 2118 | | |
2119 | 2119 | | |
2120 | | - | |
2121 | | - | |
| 2120 | + | |
2122 | 2121 | | |
2123 | | - | |
| 2122 | + | |
2124 | 2123 | | |
2125 | 2124 | | |
2126 | 2125 | | |
2127 | 2126 | | |
2128 | 2127 | | |
2129 | 2128 | | |
2130 | | - | |
2131 | | - | |
2132 | | - | |
2133 | | - | |
2134 | | - | |
2135 | | - | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
2136 | 2139 | | |
2137 | 2140 | | |
| 2141 | + | |
2138 | 2142 | | |
2139 | 2143 | | |
| 2144 | + | |
2140 | 2145 | | |
2141 | 2146 | | |
2142 | 2147 | | |
| |||
2169 | 2174 | | |
2170 | 2175 | | |
2171 | 2176 | | |
| 2177 | + | |
2172 | 2178 | | |
2173 | 2179 | | |
2174 | 2180 | | |
| |||
2196 | 2202 | | |
2197 | 2203 | | |
2198 | 2204 | | |
2199 | | - | |
2200 | | - | |
| 2205 | + | |
| 2206 | + | |
2201 | 2207 | | |
2202 | 2208 | | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
2203 | 2215 | | |
2204 | 2216 | | |
2205 | | - | |
2206 | | - | |
2207 | 2217 | | |
2208 | 2218 | | |
2209 | 2219 | | |
| |||
0 commit comments