]> git.baikalelectronics.ru Git - kernel.git/commit
spi: fsl-lpspi: Pre-initialize ret in fsl_lpspi_transfer_one_msg()
authorGeert Uytterhoeven <geert@linux-m68k.org>
Wed, 14 Dec 2016 11:20:55 +0000 (12:20 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 14 Dec 2016 14:31:13 +0000 (14:31 +0000)
commit0fc6c94b3c42a17b63ed3a095f715457754233d5
treefea0220214eaeaaf04ca80e8127acf984f7b97fa
parent61e97e732ac8f4496397abff47ad11acd8290ca8
spi: fsl-lpspi: Pre-initialize ret in fsl_lpspi_transfer_one_msg()

With gcc 4.1.2:

    drivers/spi/spi-fsl-lpspi.c: In function ‘fsl_lpspi_transfer_one_msg’:
    drivers/spi/spi-fsl-lpspi.c:369: warning: ‘ret’ may be used uninitialized in this function

If the message contains no transfers, the function will set the
message's status to an uninitialized value, and will return that
uninitialized value.

While __spi_validate() should have been called in all paths leading to
this, and thus have rejected such messages, we better pre-initialize ret
to be safe for future modifications (spi_transfer_one_message() also
does this).

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-fsl-lpspi.c