Skip to content

Commit 1e24c54

Browse files
haukeStefan-Schmidt
authored andcommitted
ca8210: Fix crash by zero initializing data
The struct cas_control embeds multiple generic SPI structures and we have to make sure these structures are initialized to default values. This driver does not set all attributes. When using kmalloc before some attributes were not initialized and contained random data which caused random crashes at bootup. Fixes: ded845a ("ieee802154: Add CA8210 IEEE 802.15.4 device driver") Signed-off-by: Hauke Mehrtens <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stefan Schmidt <[email protected]>
1 parent 4d002d6 commit 1e24c54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ieee802154/ca8210.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ static int ca8210_spi_transfer(
885885

886886
dev_dbg(&spi->dev, "%s called\n", __func__);
887887

888-
cas_ctl = kmalloc(sizeof(*cas_ctl), GFP_ATOMIC);
888+
cas_ctl = kzalloc(sizeof(*cas_ctl), GFP_ATOMIC);
889889
if (!cas_ctl)
890890
return -ENOMEM;
891891

0 commit comments

Comments
 (0)