]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: fix double kfree in smc_listen_work()
authorUrsula Braun <ubraun@linux.ibm.com>
Thu, 17 Sep 2020 20:46:02 +0000 (22:46 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Sep 2020 01:03:56 +0000 (18:03 -0700)
commitba795d29ab99a4a1ca062229515760593b1e63cd
tree7fd9fa611ca18c7bddb2ef56af8aae7c1a23c803
parent4c84f48aaab0f3c6d03de711ee373b4600288e75
net/smc: fix double kfree in smc_listen_work()

If smc_listen_rmda_finish() returns with an error, the storage
addressed by 'buf' is freed a second time.
Consolidate freeing under a common label and jump to that label.

Fixes: eff131cf0b04 ("net/smc: dynamic allocation of CLC proposal buffer")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/af_smc.c