summaryrefslogtreecommitdiffstats
path: root/super-intel.c
diff options
context:
space:
mode:
authorArtur Wojcik <artur.wojcik@intel.com>2009-12-10 12:03:39 -0700
committerDan Williams <dan.j.williams@intel.com>2009-12-10 12:03:39 -0700
commit791b666ae864cbd6f6c4513859afeb5fc624d02f (patch)
treef3f299775fd13e188bfcc317f1aa652637dfd1d3 /super-intel.c
parentd10d56feb88ef8a625ec39e04d7c8b711bf08870 (diff)
downloadmdadm-791b666ae864cbd6f6c4513859afeb5fc624d02f.tar.gz
mdadm-791b666ae864cbd6f6c4513859afeb5fc624d02f.tar.xz
mdadm-791b666ae864cbd6f6c4513859afeb5fc624d02f.zip
Fix for NULL pointer dereference.
Pointers '_dev' and '_disk' returned from call to function '_get_imsm_dev' and '_get_imsm_disk' may be NULL and will be dereferenced at lines 2933 and 2934, respectively. Signed-off-by: Artur Wojcik <artur.wojcik@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'super-intel.c')
-rw-r--r--super-intel.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/super-intel.c b/super-intel.c
index 03dcbd5..49e938d 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -2938,6 +2938,10 @@ static int add_to_super_imsm_volume(struct supertype *st, mdu_disk_info_t *dk,
struct imsm_dev *_dev = __get_imsm_dev(mpb, 0);
struct imsm_disk *_disk = __get_imsm_disk(mpb, dl->index);
+ if (!_dev || !_disk) {
+ fprintf(stderr, Name ": BUG mpb setup error\n");
+ return 1;
+ }
*_dev = *dev;
*_disk = dl->disk;
sum = random32();