]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
EDAC, i7core: Fix memleaks and use-after-free on probe and remove
authorJohan Hovold <johan@kernel.org>
Tue, 12 Jun 2018 12:43:35 +0000 (14:43 +0200)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:51:06 +0000 (19:51 -0600)
commita7f1f60ae01c75805ce89608271e58a268785b4e
tree1b81497f9187cb2a0e8438334f28fbd1970b9324
parentdb2cad3d3a2392e3ec36a53d9c62205ed001824d
EDAC, i7core: Fix memleaks and use-after-free on probe and remove

BugLink: https://bugs.launchpad.net/bugs/1836287
[ Upstream commit 6c974d4dfafe5e9ee754f2a6fba0eb1864f1649e ]

Make sure to free and deregister the addrmatch and chancounts devices
allocated during probe in all error paths. Also fix use-after-free in a
probe error path and in the remove success path where the devices were
being put before before deregistration.

Signed-off-by: Johan Hovold <johan@kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-edac <linux-edac@vger.kernel.org>
Fixes: 356f0a30860d ("i7core_edac: change the mem allocation scheme to make Documentation/kobject.txt happy")
Link: http://lkml.kernel.org/r/20180612124335.6420-2-johan@kernel.org
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/edac/i7core_edac.c