]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: cleanup buffer usage in smc_listen_work()
authorKarsten Graul <kgraul@linux.ibm.com>
Wed, 7 Oct 2020 20:57:42 +0000 (22:57 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 10 Oct 2020 01:15:47 +0000 (18:15 -0700)
commit8b5a2e6703cf8491b93fcb60b7519eeecf9dd9bc
treefe753701031987c1339963808b2e264bc97462af
parent847d87d4251b901341ba0d4d9789fc97266e4115
net/smc: cleanup buffer usage in smc_listen_work()

coccinelle informs about
net/smc/af_smc.c:1770:10-11: WARNING: opportunity for kzfree/kvfree_sensitive

Its not that kzfree() would help here, the memset() is done to prepare
the buffer for another socket receive.
Fix that warning message by reordering the calls, while at it eliminate
the unneeded variable cclc2 and use sizeof(*buf) as above in the same
function. No functional changes.

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/smc/af_smc.c