net/smc: fix null pointer dereference in smc_listen_decline()
authorKarsten Graul <kgraul@linux.ibm.com>
Fri, 23 Oct 2020 18:48:28 +0000 (20:48 +0200)
committerJakub Kicinski <kuba@kernel.org>
Mon, 26 Oct 2020 23:29:14 +0000 (16:29 -0700)
commit21ff8100ee8c1764c361e2fff515082a73bf5fd4
tree11e2b78bc086e3056f74bca53ed5195682f689fe
parent9c709b67eee047fc6a8f3b0f0cdc0e868b36d1dc
net/smc: fix null pointer dereference in smc_listen_decline()

smc_listen_work() calls smc_listen_decline() on label out_decl,
providing the ini pointer variable. But this pointer can still be null
when the label out_decl is reached.
Fix this by checking the ini variable in smc_listen_work() and call
smc_listen_decline() with the result directly.

Fixes: 338fa21f1190 ("net/smc: CLC accept / confirm V2")
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/smc/af_smc.c