Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe09b32a authored by Jesper Juhl's avatar Jesper Juhl Committed by John W. Linville
Browse files

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: default avatarJesper Juhl <jj@chaosbits.net>
Acked-by: default avatarDan Williams <dcbw@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ed66ba47
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;