summaryrefslogtreecommitdiff
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
commit4e9d21862d0fbea7e028ff3a48a0b734440e6015 (patch)
treec2141becd5ee1ddc44ab738e6f1693a643904ec8 /super-intel.c
parentc3ca5f60282b263808dff6b0b77538d2207c3568 (diff)
Fix for NULL pointer dereference defect.
Pointer 'st' returned from call to function 'malloc' at line 320 may be NULL and it will be dereferenced at line 321. 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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/super-intel.c b/super-intel.c
index cf6288f0..a2acaaf2 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -318,6 +318,8 @@ static struct supertype *match_metadata_desc_imsm(char *arg)
return NULL;
st = malloc(sizeof(*st));
+ if (!st)
+ return NULL;
memset(st, 0, sizeof(*st));
st->ss = &super_imsm;
st->max_devs = IMSM_MAX_DEVICES;