spi: armada-3700: fix unsigned compare than zero on irq
spi->irq is an unsigned integer hence the check if status is less than zero has no effect. Fix this by replacing spi->irq with an int irq so the less than zero compare will correctly detect errors. Issue found with static analysis with CoverityScan, CID1388567 Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Romain Perier <romain.perier@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Родитель
fafd679407
Коммит
f6f0083cca
|
@ -800,7 +800,7 @@ static int a3700_spi_probe(struct platform_device *pdev)
|
||||||
struct spi_master *master;
|
struct spi_master *master;
|
||||||
struct a3700_spi *spi;
|
struct a3700_spi *spi;
|
||||||
u32 num_cs = 0;
|
u32 num_cs = 0;
|
||||||
int ret = 0;
|
int irq, ret = 0;
|
||||||
|
|
||||||
master = spi_alloc_master(dev, sizeof(*spi));
|
master = spi_alloc_master(dev, sizeof(*spi));
|
||||||
if (!master) {
|
if (!master) {
|
||||||
|
@ -846,12 +846,13 @@ static int a3700_spi_probe(struct platform_device *pdev)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
spi->irq = platform_get_irq(pdev, 0);
|
irq = platform_get_irq(pdev, 0);
|
||||||
if (spi->irq < 0) {
|
if (irq < 0) {
|
||||||
dev_err(dev, "could not get irq: %d\n", spi->irq);
|
dev_err(dev, "could not get irq: %d\n", irq);
|
||||||
ret = -ENXIO;
|
ret = -ENXIO;
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
spi->irq = irq;
|
||||||
|
|
||||||
init_completion(&spi->done);
|
init_completion(&spi->done);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче