]> git.baikalelectronics.ru Git - kernel.git/commit
fpga manager: Fix firmware resource leak on error
authorTobias Klauser <tklauser@distanz.ch>
Wed, 18 Nov 2015 09:48:16 +0000 (10:48 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Nov 2015 23:25:46 +0000 (15:25 -0800)
commitb1d56eea61faca0eedeeac740e5356f924f62b6b
tree966ff193f3eb29d69dc31face6da2f37c4191c3e
parent0e3abb975fd917bdc3edfd43f2934a25f317e829
fpga manager: Fix firmware resource leak on error

If fpga_mgr_buf_load() fails, the firmware resource previously allocated
by request_firmware() is leaked. Fix it by calling release_firmware()
regardless of the return value of fpga_mgr_buf_load().

Found by the Coverity scanner (CID 1339653).

Fixes: bf06bee2673c ("add FPGA manager core")
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: Alan Tull <atull@opensource.altera.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/fpga/fpga-mgr.c