Whamcloud - gitweb
LU-11700 osp: GPF in osp_reserved_mb_low_seq_write() 17/33717/2
authorAndriy Skulysh <c17819@cray.com>
Wed, 20 Jun 2018 14:17:09 +0000 (17:17 +0300)
committerOleg Drokin <green@whamcloud.com>
Fri, 4 Jan 2019 04:48:16 +0000 (04:48 +0000)
opd_pre pointer may be uninitialized on statrup

Change-Id: If6ff4289545503e07719c7e9a282be1bd393465b
Cray-bug-id: LUS-6118
Signed-off-by: Andriy Skulysh <c17819@cray.com>
Reviewed-by: Alexander Boyko <c17825@cray.com>
Reviewed-by: Andrew Perepechko <c17827@cray.com>
Reviewed-on: https://review.whamcloud.com/33717
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alexandr Boyko <c17825@cray.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osp/lproc_osp.c

index e1d5509..59c90e2 100644 (file)
@@ -835,7 +835,7 @@ osp_reserved_mb_high_seq_write(struct file *file, const char __user *buffer,
        __s64                   val;
        int                     rc;
 
        __s64                   val;
        int                     rc;
 
-       if (osp == NULL)
+       if (osp == NULL || osp->opd_pre == NULL)
                return -EINVAL;
 
        rc = lprocfs_str_with_units_to_s64(buffer, count, &val, 'M');
                return -EINVAL;
 
        rc = lprocfs_str_with_units_to_s64(buffer, count, &val, 'M');
@@ -896,7 +896,7 @@ osp_reserved_mb_low_seq_write(struct file *file, const char __user *buffer,
        __s64                   val;
        int                     rc;
 
        __s64                   val;
        int                     rc;
 
-       if (osp == NULL)
+       if (osp == NULL || osp->opd_pre == NULL)
                return -EINVAL;
 
        rc = lprocfs_str_with_units_to_s64(buffer, count, &val, 'M');
                return -EINVAL;
 
        rc = lprocfs_str_with_units_to_s64(buffer, count, &val, 'M');