Skip to content

Commit 45ae076

Browse files
mu-mu-mugregkh
authored andcommitted
ieee802154: ca8210: Add missing check for kfifo_alloc() in ca8210_probe()
[ Upstream commit 2c87309 ] ca8210_test_interface_init() returns the result of kfifo_alloc(), which can be non-zero in case of an error. The caller, ca8210_probe(), should check the return value and do error-handling if it fails. Fixes: ded845a ("ieee802154: Add CA8210 IEEE 802.15.4 device driver") Signed-off-by: Keisuke Nishimura <keisuke.nishimura@inria.fr> Reviewed-by: Simon Horman <horms@kernel.org> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/20241029182712.318271-1-keisuke.nishimura@inria.fr Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 6c37547 commit 45ae076

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/net/ieee802154/ca8210.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3078,7 +3078,11 @@ static int ca8210_probe(struct spi_device *spi_device)
30783078
spi_set_drvdata(priv->spi, priv);
30793079
if (IS_ENABLED(CONFIG_IEEE802154_CA8210_DEBUGFS)) {
30803080
cascoda_api_upstream = ca8210_test_int_driver_write;
3081-
ca8210_test_interface_init(priv);
3081+
ret = ca8210_test_interface_init(priv);
3082+
if (ret) {
3083+
dev_crit(&spi_device->dev, "ca8210_test_interface_init failed\n");
3084+
goto error;
3085+
}
30823086
} else {
30833087
cascoda_api_upstream = NULL;
30843088
}

0 commit comments

Comments
 (0)