From: Adam Kwolek Date: Tue, 14 Jun 2011 02:48:58 +0000 (+1000) Subject: imsm: FIX: klocwork: passed dev pointer to is_gen_migration() can be NULL X-Git-Tag: mdadm-3.2.2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7534230b07cffa1cd74153a344090c1892fcebdc;p=thirdparty%2Fmdadm.git 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 Signed-off-by: NeilBrown --- diff --git a/super-intel.c b/super-intel.c index 6c74e503..5dc8ca8a 100644 --- a/super-intel.c +++ b/super-intel.c @@ -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;