Commit 26877c79 authored by Jesper Juhl's avatar Jesper Juhl Committed by David S. Miller

hamradio: Resolve memory leak due to missing firmware release in add_mcs()

Failure to release_firmware() in drivers/net/hamradio/yam.c::add_mcs()
causes memory leak.
This patch should fix it.
Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b5680e0b
...@@ -396,7 +396,7 @@ static unsigned char *add_mcs(unsigned char *bits, int bitrate, ...@@ -396,7 +396,7 @@ static unsigned char *add_mcs(unsigned char *bits, int bitrate,
while (p) { while (p) {
if (p->bitrate == bitrate) { if (p->bitrate == bitrate) {
memcpy(p->bits, bits, YAM_FPGA_SIZE); memcpy(p->bits, bits, YAM_FPGA_SIZE);
return p->bits; goto out;
} }
p = p->next; p = p->next;
} }
...@@ -411,7 +411,7 @@ static unsigned char *add_mcs(unsigned char *bits, int bitrate, ...@@ -411,7 +411,7 @@ static unsigned char *add_mcs(unsigned char *bits, int bitrate,
p->bitrate = bitrate; p->bitrate = bitrate;
p->next = yam_data; p->next = yam_data;
yam_data = p; yam_data = p;
out:
release_firmware(fw); release_firmware(fw);
return p->bits; return p->bits;
} }
......
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