Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c393e9b2 authored by Randy Dunlap's avatar Randy Dunlap Committed by Oded Gabbay
Browse files

drm/amdkfd: fix amdkfd use-after-free GP fault



Fix GP fault caused by dev_info() reference to a struct device*
after the device has been freed (use after free).
kfd_chardev_exit() frees the device so 'kfd_device' should not
be used after calling kfd_chardev_exit().

Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Signed-off-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
parent 8c946b89
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include <linux/sched.h>
#include <linux/moduleparam.h>
#include <linux/device.h>
#include <linux/printk.h>
#include "kfd_priv.h"

#define KFD_DRIVER_AUTHOR	"AMD Inc. and others"
@@ -132,7 +133,7 @@ static void __exit kfd_module_exit(void)
	kfd_process_destroy_wq();
	kfd_topology_shutdown();
	kfd_chardev_exit();
	dev_info(kfd_device, "Removed module\n");
	pr_info("amdkfd: Removed module\n");
}

module_init(kfd_module_init);