spi: core: Fix error code in spi_register_controller()
Return -ENOMEM if the allocation fails. Don't return success.
Fixes: 6598b91b5a
("spi: spi.c: Convert statistics to per-cpu u64_stats_t")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/Yqh6bdNYO2XNhPBa@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
d38dc01a4e
commit
d52b095b6c
@ -3082,6 +3082,7 @@ int spi_register_controller(struct spi_controller *ctlr)
|
||||
ctlr->pcpu_statistics = spi_alloc_pcpu_stats(dev);
|
||||
if (!ctlr->pcpu_statistics) {
|
||||
dev_err(dev, "Error allocating per-cpu statistics\n");
|
||||
status = -ENOMEM;
|
||||
goto destroy_queue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user