Commit d52b095b authored by Dan Carpenter's avatar Dan Carpenter Committed by Mark Brown

spi: core: Fix error code in spi_register_controller()

Return -ENOMEM if the allocation fails.  Don't return success.

Fixes: 6598b91b ("spi: spi.c: Convert statistics to per-cpu u64_stats_t")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/Yqh6bdNYO2XNhPBa@kiliSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent d38dc01a
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment