Fix coverity defects: 154021

CID 154021: Null pointer dereference

Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: luozhengzheng <luo.zhengzheng@zte.com.cn>
Closes #5380
This commit is contained in:
luozhengzheng 2016-11-09 06:34:52 +08:00 committed by Brian Behlendorf
parent a36cc8d242
commit 70df4c21c0

View File

@ -300,6 +300,9 @@ fmd_serd_eng_gc(fmd_serd_eng_t *sgp)
return; /* no garbage collection needed if empty or fired */ return; /* no garbage collection needed if empty or fired */
sep = list_head(&sgp->sg_list); sep = list_head(&sgp->sg_list);
if (sep == NULL)
return;
hrt = sep->se_hrt - sgp->sg_t; hrt = sep->se_hrt - sgp->sg_t;
for (sep = list_head(&sgp->sg_list); sep != NULL; sep = nep) { for (sep = list_head(&sgp->sg_list); sep != NULL; sep = nep) {