Skip to content

Commit

Permalink
hamradio: Resolve memory leak due to missing firmware release in add_…
Browse files Browse the repository at this point in the history
…mcs()

Failure to release_firmware() in drivers/net/hamradio/yam.c::add_mcs()
causes memory leak.
This patch should fix it.

Signed-off-by: Jesper Juhl <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
jjuhl authored and davem330 committed Jan 9, 2011
1 parent b5680e0 commit 26877c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/hamradio/yam.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ static unsigned char *add_mcs(unsigned char *bits, int bitrate,
while (p) {
if (p->bitrate == bitrate) {
memcpy(p->bits, bits, YAM_FPGA_SIZE);
return p->bits;
goto out;
}
p = p->next;
}
Expand All @@ -411,7 +411,7 @@ static unsigned char *add_mcs(unsigned char *bits, int bitrate,
p->bitrate = bitrate;
p->next = yam_data;
yam_data = p;

out:
release_firmware(fw);
return p->bits;
}
Expand Down

0 comments on commit 26877c7

Please sign in to comment.