mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
Net, libertas: Resolve memory leak in if_spi_host_to_card()
If we hit the default case in the switch in if_spi_host_to_card() we'll leak the memory we allocated for 'packet'. This patch resolves the leak by freeing the allocated memory in that case. Signed-off-by: Jesper Juhl <[email protected]> Acked-by: Dan Williams <[email protected]> Cc: [email protected] Signed-off-by: John W. Linville <[email protected]>
This commit is contained in:
parent
ed66ba472a
commit
fe09b32a43
1 changed files with 1 additions and 0 deletions
|
|
@ -995,6 +995,7 @@ static int if_spi_host_to_card(struct lbs_private *priv,
|
|||
spin_unlock_irqrestore(&card->buffer_lock, flags);
|
||||
break;
|
||||
default:
|
||||
kfree(packet);
|
||||
netdev_err(priv->dev, "can't transfer buffer of type %d\n",
|
||||
type);
|
||||
err = -EINVAL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue