Wenwen Wang 8d4611f342 test_firmware: fix a memory leak bug
[ Upstream commit d4fddac5a51c378c5d3e68658816c37132611e1f ]

In test_firmware_init(), the buffer pointed to by the global pointer
'test_fw_config' is allocated through kzalloc(). Then, the buffer is
initialized in __test_firmware_config_init(). In the case that the
initialization fails, the following execution in test_firmware_init() needs
to be terminated with an error code returned to indicate this failure.
However, the allocated buffer is not freed on this execution path, leading
to a memory leak bug.

To fix the above issue, free the allocated buffer before returning from
test_firmware_init().

Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Link: https://lore.kernel.org/r/1563084696-6865-1-git-send-email-wang6495@umn.edu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-08-16 10:13:55 +02:00
..
2019-07-10 09:54:40 +02:00
2017-08-15 09:02:08 -07:00
2017-06-09 11:52:07 +02:00
2017-02-24 17:46:57 -08:00
2019-04-20 09:15:07 +02:00
2017-05-09 15:40:28 -07:00
2017-02-24 17:46:57 -08:00
2017-10-03 17:54:25 -07:00
2019-05-21 18:50:21 +02:00
2018-02-16 20:23:04 +01:00
2018-12-08 13:03:35 +01:00
2016-12-06 10:17:03 +02:00
2018-12-13 09:18:52 +01:00
2017-08-15 09:02:07 -07:00