mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-03 09:41:54 +09:00
Net, libertas: Resolve memory leak in if_spi_host_to_card()
commit fe09b32a43 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a633bc89bb
commit
78724db116
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user