aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRandy Dunlap <rdunlap@infradead.org>2017-11-13 11:08:48 -0500
committerOded Gabbay <oded.gabbay@gmail.com>2017-11-26 04:31:32 -0500
commitc393e9b2d51540b74e18e555df14706098dbf2cc (patch)
treee69965617b2ee943ba703fbbfff9027690191723
parent8c946b8988acec785bcf67088b6bd0747f36d2d3 (diff)
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: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_module.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_module.c b/drivers/gpu/drm/amd/amdkfd/kfd_module.c
index 6c5a9cab55de..f744caeaee04 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_module.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_module.c
@@ -24,6 +24,7 @@
24#include <linux/sched.h> 24#include <linux/sched.h>
25#include <linux/moduleparam.h> 25#include <linux/moduleparam.h>
26#include <linux/device.h> 26#include <linux/device.h>
27#include <linux/printk.h>
27#include "kfd_priv.h" 28#include "kfd_priv.h"
28 29
29#define KFD_DRIVER_AUTHOR "AMD Inc. and others" 30#define KFD_DRIVER_AUTHOR "AMD Inc. and others"
@@ -132,7 +133,7 @@ static void __exit kfd_module_exit(void)
132 kfd_process_destroy_wq(); 133 kfd_process_destroy_wq();
133 kfd_topology_shutdown(); 134 kfd_topology_shutdown();
134 kfd_chardev_exit(); 135 kfd_chardev_exit();
135 dev_info(kfd_device, "Removed module\n"); 136 pr_info("amdkfd: Removed module\n");
136} 137}
137 138
138module_init(kfd_module_init); 139module_init(kfd_module_init);