linux/net/smc
Geert Uytterhoeven 6887037025 net/smc: Fix preinitialization of buf_desc in __smc_buf_create()
With gcc-4.1.2:

    net/smc/smc_core.c: In function ‘__smc_buf_create’:
    net/smc/smc_core.c:567: warning: ‘bufsize’ may be used uninitialized in this function

Indeed, if the for-loop is never executed, bufsize is used
uninitialized.  In addition, buf_desc is stored for later use, while it
is still a NULL pointer.

Before, error handling was done by checking if buf_desc is non-NULL.
The cleanup changed this to an error check, but forgot to update the
preinitialization of buf_desc to an error pointer.

Update the preinitializatin of buf_desc to fix this.

Fixes: b33982c3a6 ("net/smc: cleanup function __smc_buf_create()")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-11-24 01:33:34 +09:00
..
Kconfig
Makefile
af_smc.c
smc.h
smc_cdc.c
smc_cdc.h
smc_clc.c
smc_clc.h
smc_close.c
smc_close.h
smc_core.c net/smc: Fix preinitialization of buf_desc in __smc_buf_create() 2017-11-24 01:33:34 +09:00
smc_core.h
smc_diag.c
smc_ib.c
smc_ib.h
smc_llc.c
smc_llc.h
smc_pnet.c
smc_pnet.h
smc_rx.c
smc_rx.h
smc_tx.c
smc_tx.h
smc_wr.c
smc_wr.h