diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2022-11-21 03:22:01 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-12-14 13:37:23 +0300 |
commit | 246bcd05ba6cc43b34ac0bb4bac3ea94a4efa07c (patch) | |
tree | d42327ff8296ef39c370b0a30dbe0a1064b15c18 /drivers | |
parent | 80dad8df5fc20f9135b739ae57d7079ef99d9171 (diff) | |
download | linux-246bcd05ba6cc43b34ac0bb4bac3ea94a4efa07c.tar.xz |
ca8210: Fix crash by zero initializing data
[ Upstream commit 1e24c54da257ab93cff5826be8a793b014a5dc9c ]
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: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Link: https://lore.kernel.org/r/20221121002201.1339636-1-hauke@hauke-m.de
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ieee802154/ca8210.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c index 96592a20c61f..0362917fce7a 100644 --- a/drivers/net/ieee802154/ca8210.c +++ b/drivers/net/ieee802154/ca8210.c @@ -927,7 +927,7 @@ static int ca8210_spi_transfer( dev_dbg(&spi->dev, "%s called\n", __func__); - cas_ctl = kmalloc(sizeof(*cas_ctl), GFP_ATOMIC); + cas_ctl = kzalloc(sizeof(*cas_ctl), GFP_ATOMIC); if (!cas_ctl) return -ENOMEM; |