imsm: FIX: klocwork: passed dev pointer to is_gen_migration() can be NULL

Pointer dev2 passed in write_super_imsm():4451 can be equal to NULL.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Adam Kwolek 2011-06-14 12:48:58 +10:00 committed by NeilBrown
parent 7e45b5504c
commit 7534230b07
1 changed files with 3 additions and 0 deletions

View File

@ -5312,6 +5312,9 @@ static int update_subarray_imsm(struct supertype *st, char *subarray,
static int is_gen_migration(struct imsm_dev *dev)
{
if (dev == NULL)
return 0;
if (!dev->vol.migr_state)
return 0;