diff options
author | Jesper Juhl <jj@chaosbits.net> | 2011-11-13 22:14:32 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-26 09:09:54 -0800 |
commit | 78724db116c88705db2d6acbe66c56bed90fc991 (patch) | |
tree | e011b6b3b929b6cbe42651132dd97e49fa41322c | |
parent | a633bc89bb5626c6d700c3fc5c3bee01da79ce47 (diff) | |
download | kernel_samsung_espresso10-78724db116c88705db2d6acbe66c56bed90fc991.zip kernel_samsung_espresso10-78724db116c88705db2d6acbe66c56bed90fc991.tar.gz kernel_samsung_espresso10-78724db116c88705db2d6acbe66c56bed90fc991.tar.bz2 |
Net, libertas: Resolve memory leak in if_spi_host_to_card()
commit fe09b32a4361bea44169b2063e8c867cabb6a8ba upstream.
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 <jj@chaosbits.net>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/net/wireless/libertas/if_spi.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c index 463352c..db39742 100644 --- a/drivers/net/wireless/libertas/if_spi.c +++ b/drivers/net/wireless/libertas/if_spi.c @@ -997,6 +997,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; |