]> 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)
commite665931bea3dc5ad04c2c260d6252da735de39a0
tree9852a683a7e82255860b1e22fefb7864544de300
parent48d802d29d54b6049e4b76a7f7b246789edd8f4b
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