mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
spi/s3c64xx: improve error handling
When a device tree definition os an s3c64xx SPI master is missing a "controller-data" subnode, the newly added s3c64xx_get_slave_ctrldata function might use uninitialized memory in place of that node, which was correctly reported by gcc. Without this patch, building s3c6400_defconfig results in: drivers/spi/spi-s3c64xx.c: In function 's3c64xx_get_slave_ctrldata.isra.25': drivers/spi/spi-s3c64xx.c:841:5: warning: 'data_np' may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Thomas Abraham <[email protected]> Acked-by: Kukjin Kim <[email protected]> Cc: Jaswinder Singh <[email protected]> Cc: Grant Likely <[email protected]>
This commit is contained in:
parent
d680e2c11e
commit
4732cc6360
1 changed files with 1 additions and 1 deletions
|
|
@ -826,7 +826,7 @@ static struct s3c64xx_spi_csinfo *s3c64xx_get_slave_ctrldata(
|
|||
struct spi_device *spi)
|
||||
{
|
||||
struct s3c64xx_spi_csinfo *cs;
|
||||
struct device_node *slave_np, *data_np;
|
||||
struct device_node *slave_np, *data_np = NULL;
|
||||
u32 fb_delay = 0;
|
||||
|
||||
slave_np = spi->dev.of_node;
|
||||
|
|
|
|||
Loading…
Reference in a new issue