]> git.baikalelectronics.ru Git - kernel.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)
commit2257711f2163a1f5e6725d16e8c1b60e807c9e67
tree9852a683a7e82255860b1e22fefb7864544de300
parent41c67b507b5324256b053b9b97834e3f83fdbf00
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