Free SKB when i2400m_rx() returns non-zero value. Signed-off-by: Doug Kehn <rdkehn at yahoo.com> --- drivers/net/wimax/i2400m/i2400m.h | 2 +- drivers/net/wimax/i2400m/rx.c | 2 +- drivers/net/wimax/i2400m/sdio-rx.c | 3 ++- drivers/net/wimax/i2400m/usb-rx.c | 2 ++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/wimax/i2400m/i2400m.h b/drivers/net/wimax/i2400m/i2400m.h index 59ac770..a4e96f8 100644 --- a/drivers/net/wimax/i2400m/i2400m.h +++ b/drivers/net/wimax/i2400m/i2400m.h @@ -881,7 +881,7 @@ extern void i2400m_error_recovery(struct i2400m *); extern int i2400m_setup(struct i2400m *, enum i2400m_bri bm_flags); extern void i2400m_release(struct i2400m *); -extern int i2400m_rx(struct i2400m *, struct sk_buff *); +extern int __must_check i2400m_rx(struct i2400m *, struct sk_buff *); extern struct i2400m_msg_hdr *i2400m_tx_msg_get(struct i2400m *, size_t *); extern void i2400m_tx_msg_sent(struct i2400m *); diff --git a/drivers/net/wimax/i2400m/rx.c b/drivers/net/wimax/i2400m/rx.c index 844133b..1e782ff 100644 --- a/drivers/net/wimax/i2400m/rx.c +++ b/drivers/net/wimax/i2400m/rx.c @@ -1239,7 +1239,7 @@ error: * to run kfree_skb() on it. However, on error, the caller still owns * the skb and it is responsible for releasing it. */ -int i2400m_rx(struct i2400m *i2400m, struct sk_buff *skb) +int __must_check i2400m_rx(struct i2400m *i2400m, struct sk_buff *skb) { int i, result; struct device *dev = i2400m_dev(i2400m); diff --git a/drivers/net/wimax/i2400m/sdio-rx.c b/drivers/net/wimax/i2400m/sdio-rx.c index fb6396d..b6cedaa 100644 --- a/drivers/net/wimax/i2400m/sdio-rx.c +++ b/drivers/net/wimax/i2400m/sdio-rx.c @@ -177,7 +177,8 @@ void i2400ms_rx(struct i2400ms *i2400ms) } if (likely(i2400m_is_d2h_barker(skb->data))) { skb_put(skb, rx_size); - i2400m_rx(i2400m, skb); + if (i2400m_rx(i2400m, skb)) + kfree_skb(skb); } else if (unlikely(i2400m_is_boot_barker(i2400m, skb->data, rx_size))) { ret = i2400m_dev_reset_handle(i2400m, "device rebooted"); diff --git a/drivers/net/wimax/i2400m/usb-rx.c b/drivers/net/wimax/i2400m/usb-rx.c index a26483a..c84e671 100644 --- a/drivers/net/wimax/i2400m/usb-rx.c +++ b/drivers/net/wimax/i2400m/usb-rx.c @@ -383,6 +383,8 @@ int i2400mu_rxd(void *_i2400mu) i2400mu->rx_size_cnt++; i2400mu->rx_size_acc += rx_skb->len; result = i2400m_rx(i2400m, rx_skb); + if (result) + kfree_skb(rx_skb); if (result == -EIO && edc_inc(&i2400mu->urb_edc, EDC_MAX_ERRORS, EDC_ERROR_TIMEFRAME)) { -- 1.7.1