]> git.ipfire.org Git - thirdparty/qemu.git/commit
block/pflash_cfi02: Fix memory leak and potential use-after-free
authorStephen Checkoway <stephen.checkoway@oberlin.edu>
Tue, 19 Feb 2019 15:37:27 +0000 (10:37 -0500)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 30 Jul 2019 20:07:18 +0000 (15:07 -0500)
commitd0cb4402807514ed5c9e3e28d8f6f65ac6a01abf
tree6f6fdb876b3502117c07122aff43a5ef9dfba30c
parent21e5c69b85e0532a009bebe0351a3ab4ef1e0143
block/pflash_cfi02: Fix memory leak and potential use-after-free

Don't dynamically allocate the pflash's timer. But do use timer_del in
an unrealize function to make sure that the timer can't fire after the
pflash_t has been freed.

Signed-off-by: Stephen Checkoway <stephen.checkoway@oberlin.edu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Wei Yang <richardw.yang@linux.intel.com>
Message-Id: <20190219153727.62279-1-stephen.checkoway@oberlin.edu>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
(cherry picked from commit d80cf1eb2e87df3a9bfb226bcc7fb3a1aa858817)
*prereq for 16434065/3a283507
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/block/pflash_cfi02.c