Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ieee802154: ca8210: Add missing check for kfifo_alloc() in ca8210_probe()

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: ded845a781a5 ("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>

authored by

Keisuke Nishimura and committed by
Stefan Schmidt
2c87309e 66418447

+5 -1
+5 -1
drivers/net/ieee802154/ca8210.c
··· 3072 3072 spi_set_drvdata(priv->spi, priv); 3073 3073 if (IS_ENABLED(CONFIG_IEEE802154_CA8210_DEBUGFS)) { 3074 3074 cascoda_api_upstream = ca8210_test_int_driver_write; 3075 - ca8210_test_interface_init(priv); 3075 + ret = ca8210_test_interface_init(priv); 3076 + if (ret) { 3077 + dev_crit(&spi_device->dev, "ca8210_test_interface_init failed\n"); 3078 + goto error; 3079 + } 3076 3080 } else { 3077 3081 cascoda_api_upstream = NULL; 3078 3082 }