]> git.karo-electronics.de Git - linux-beck.git/commit
Staging: wlan-ng: memory allocated inside mkimage() is not freed if subsequent calls...
authorClaudiu Beznea <claudiu.beznea@gmail.com>
Sun, 24 Apr 2016 16:40:13 +0000 (19:40 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 30 Apr 2016 00:43:15 +0000 (17:43 -0700)
commite26eaf457989326a41eb58754f18333308cab321
tree9852a683a7e82255860b1e22fefb7864544de300
parent02e020480daf3a7726db493ff28f9391ff6bb9c4
Staging: wlan-ng: memory allocated inside mkimage() is not freed if subsequent calls fails.

This patch frees memory allocated inside mkimage() in case mkimage()
or any other subsequent calls inside prism2_fwapply() from prism2fw.c
file fails. To fix this I introduces goto labels where the free
operation is done in case some operations fails. After the introduction
of goto labels has been done, in order to use the same return path,
"return x" instuctions were replaced with "goto" instuctions.

Signed-off-by: Claudiu Beznea <claudiu.beznea@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/prism2fw.c