It can occurs that during walking container end conditions bases on "map" function return value, so function can be protected for wrong data input. Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx> --- super-intel.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/super-intel.c b/super-intel.c index d747322..1ac6bc2 100644 --- a/super-intel.c +++ b/super-intel.c @@ -435,8 +435,12 @@ static size_t sizeof_imsm_map(struct imsm_map *map) struct imsm_map *get_imsm_map(struct imsm_dev *dev, int second_map) { - struct imsm_map *map = &dev->vol.map[0]; + struct imsm_map *map; + + if (dev == NULL) + return NULL; + map = &dev->vol.map[0]; if (second_map && !dev->vol.migr_state) return NULL; else if (second_map) { @@ -1517,6 +1521,9 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info, char *devname; int map_disks = info->array.raid_disks; + if (map == NULL) + return; + for (dl = super->disks; dl; dl = dl->next) if (dl->raiddisk == info->disk.raid_disk) break; -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html