summaryrefslogtreecommitdiff
path: root/drivers/staging/unisys/visorchipset/visorchipset_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/unisys/visorchipset/visorchipset_main.c')
-rw-r--r--drivers/staging/unisys/visorchipset/visorchipset_main.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 8252ca14695d..257c6e59b460 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -2414,6 +2414,9 @@ proc_read_installer(struct file *file, char __user *buf,
char *vbuf;
loff_t pos = *offset;
+ if (!ControlVm_channel)
+ return -ENODEV;
+
if (pos < 0)
return -EINVAL;
@@ -2463,6 +2466,9 @@ proc_write_installer(struct file *file,
U16 remainingSteps;
U32 error, textId;
+ if (!ControlVm_channel)
+ return -ENODEV;
+
/* Check to make sure there is no buffer overflow */
if (count > (sizeof(buf) - 1))
return -EINVAL;
@@ -2524,6 +2530,9 @@ proc_read_toolaction(struct file *file, char __user *buf,
char *vbuf;
loff_t pos = *offset;
+ if (!ControlVm_channel)
+ return -ENODEV;
+
if (pos < 0)
return -EINVAL;
@@ -2562,6 +2571,9 @@ proc_write_toolaction(struct file *file,
char buf[3];
U8 toolAction;
+ if (!ControlVm_channel)
+ return -ENODEV;
+
/* Check to make sure there is no buffer overflow */
if (count > (sizeof(buf) - 1))
return -EINVAL;
@@ -2601,6 +2613,9 @@ proc_read_bootToTool(struct file *file, char __user *buf,
char *vbuf;
loff_t pos = *offset;
+ if (!ControlVm_channel)
+ return -ENODEV;
+
if (pos < 0)
return -EINVAL;
@@ -2639,6 +2654,9 @@ proc_write_bootToTool(struct file *file,
int inputVal;
ULTRA_EFI_SPAR_INDICATION efiSparIndication;
+ if (!ControlVm_channel)
+ return -ENODEV;
+
/* Check to make sure there is no buffer overflow */
if (count > (sizeof(buf) - 1))
return -EINVAL;