Skip to content

Commit 92439a8

Browse files
author
Paolo Abeni
committed
Merge tag 'ieee802154-for-net-2022-12-05' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan
Stefan Schmidt says: ==================== pull-request: ieee802154 for net 2022-12-05 An update from ieee802154 for your *net* tree: Three small fixes this time around. Ziyang Xuan fixed an error code for a timeout during initialization of the cc2520 driver. Hauke Mehrtens fixed a crash in the ca8210 driver SPI communication due uninitialized SPI structures. Wei Yongjun added INIT_LIST_HEAD ieee802154_if_add() to avoid a potential null pointer dereference. ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
2 parents 4fad22a + b3d72d3 commit 92439a8

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
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

drivers/net/ieee802154/cc2520.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ static int cc2520_hw_init(struct cc2520_private *priv)
970970

971971
if (timeout-- <= 0) {
972972
dev_err(&priv->spi->dev, "oscillator start failed!\n");
973-
return ret;
973+
return -ETIMEDOUT;
974974
}
975975
udelay(1);
976976
} while (!(status & CC2520_STATUS_XOSC32M_STABLE));

net/mac802154/iface.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,7 @@ ieee802154_if_add(struct ieee802154_local *local, const char *name,
662662
sdata->dev = ndev;
663663
sdata->wpan_dev.wpan_phy = local->hw.phy;
664664
sdata->local = local;
665+
INIT_LIST_HEAD(&sdata->wpan_dev.list);
665666

666667
/* setup type-dependent data */
667668
ret = ieee802154_setup_sdata(sdata, type);

0 commit comments

Comments
 (0)