Commit 3915a252 authored by Dan Williams's avatar Dan Williams Committed by Kalle Valo

libertas: Fix a double free in if_spi_c2h_data()

The lbs_process_rxed_packet() frees the skb.  It didn't originally, but
we fixed it in commit f54930f3 ("libertas: don't leak skb on receive
error").
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDan Williams <dcbw@redhat.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent b95c7322
...@@ -766,19 +766,15 @@ static int if_spi_c2h_data(struct if_spi_card *card) ...@@ -766,19 +766,15 @@ static int if_spi_c2h_data(struct if_spi_card *card)
/* Read the data from the WLAN module into our skb... */ /* Read the data from the WLAN module into our skb... */
err = spu_read(card, IF_SPI_DATA_RDWRPORT_REG, data, ALIGN(len, 4)); err = spu_read(card, IF_SPI_DATA_RDWRPORT_REG, data, ALIGN(len, 4));
if (err) if (err) {
goto free_skb; dev_kfree_skb(skb);
goto out;
}
/* pass the SKB to libertas */ /* pass the SKB to libertas */
err = lbs_process_rxed_packet(card->priv, skb); err = lbs_process_rxed_packet(card->priv, skb);
if (err) /* lbs_process_rxed_packet() consumes the skb */
goto free_skb;
/* success */
goto out;
free_skb:
dev_kfree_skb(skb);
out: out:
if (err) if (err)
netdev_err(priv->dev, "%s: err=%d\n", __func__, err); netdev_err(priv->dev, "%s: err=%d\n", __func__, err);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment