Skip to content

Commit 6fd40d3

Browse files
committed
Merge tag 'ieee802154-for-davem-2020-09-08' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan
Stefan Schmidt says: ==================== pull-request: ieee802154 for net 2020-09-08 An update from ieee802154 for your *net* tree. A potential memory leak fix for ca8210 from Liu Jian, a check on the return for a register read in adf7242 and finally a user after free fix in the softmac tx function from Eric found by syzkaller. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 2a15498 + 0ff4628 commit 6fd40d3

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

drivers/net/ieee802154/adf7242.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,9 @@ static int adf7242_rx(struct adf7242_local *lp)
882882
int ret;
883883
u8 lqi, len_u8, *data;
884884

885-
adf7242_read_reg(lp, 0, &len_u8);
885+
ret = adf7242_read_reg(lp, 0, &len_u8);
886+
if (ret)
887+
return ret;
886888

887889
len = len_u8;
888890

drivers/net/ieee802154/ca8210.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2925,6 +2925,7 @@ static int ca8210_dev_com_init(struct ca8210_priv *priv)
29252925
);
29262926
if (!priv->irq_workqueue) {
29272927
dev_crit(&priv->spi->dev, "alloc of irq_workqueue failed!\n");
2928+
destroy_workqueue(priv->mlme_workqueue);
29282929
return -ENOMEM;
29292930
}
29302931

net/mac802154/tx.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ void ieee802154_xmit_worker(struct work_struct *work)
3434
if (res)
3535
goto err_tx;
3636

37-
ieee802154_xmit_complete(&local->hw, skb, false);
38-
3937
dev->stats.tx_packets++;
4038
dev->stats.tx_bytes += skb->len;
4139

40+
ieee802154_xmit_complete(&local->hw, skb, false);
41+
4242
return;
4343

4444
err_tx:
@@ -78,14 +78,16 @@ ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb)
7878

7979
/* async is priority, otherwise sync is fallback */
8080
if (local->ops->xmit_async) {
81+
unsigned int len = skb->len;
82+
8183
ret = drv_xmit_async(local, skb);
8284
if (ret) {
8385
ieee802154_wake_queue(&local->hw);
8486
goto err_tx;
8587
}
8688

8789
dev->stats.tx_packets++;
88-
dev->stats.tx_bytes += skb->len;
90+
dev->stats.tx_bytes += len;
8991
} else {
9092
local->tx_skb = skb;
9193
queue_work(local->workqueue, &local->tx_work);

0 commit comments

Comments
 (0)