aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/vmcore.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/vmcore.c')
-rw-r--r--fs/proc/vmcore.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
index 57957c91c6df..7bcc92add72c 100644
--- a/fs/proc/vmcore.c
+++ b/fs/proc/vmcore.c
@@ -21,6 +21,7 @@
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/crash_dump.h> 22#include <linux/crash_dump.h>
23#include <linux/list.h> 23#include <linux/list.h>
24#include <linux/moduleparam.h>
24#include <linux/mutex.h> 25#include <linux/mutex.h>
25#include <linux/vmalloc.h> 26#include <linux/vmalloc.h>
26#include <linux/pagemap.h> 27#include <linux/pagemap.h>
@@ -54,6 +55,9 @@ static struct proc_dir_entry *proc_vmcore;
54/* Device Dump list and mutex to synchronize access to list */ 55/* Device Dump list and mutex to synchronize access to list */
55static LIST_HEAD(vmcoredd_list); 56static LIST_HEAD(vmcoredd_list);
56static DEFINE_MUTEX(vmcoredd_mutex); 57static DEFINE_MUTEX(vmcoredd_mutex);
58
59static bool vmcoredd_disabled;
60core_param(novmcoredd, vmcoredd_disabled, bool, 0);
57#endif /* CONFIG_PROC_VMCORE_DEVICE_DUMP */ 61#endif /* CONFIG_PROC_VMCORE_DEVICE_DUMP */
58 62
59/* Device Dump Size */ 63/* Device Dump Size */
@@ -1452,6 +1456,11 @@ int vmcore_add_device_dump(struct vmcoredd_data *data)
1452 size_t data_size; 1456 size_t data_size;
1453 int ret; 1457 int ret;
1454 1458
1459 if (vmcoredd_disabled) {
1460 pr_err_once("Device dump is disabled\n");
1461 return -EINVAL;
1462 }
1463
1455 if (!data || !strlen(data->dump_name) || 1464 if (!data || !strlen(data->dump_name) ||
1456 !data->vmcoredd_callback || !data->size) 1465 !data->vmcoredd_callback || !data->size)
1457 return -EINVAL; 1466 return -EINVAL;