From 70df4c21c0da3baacb6601d924dd1fb2b3cad1b3 Mon Sep 17 00:00:00 2001 From: luozhengzheng Date: Wed, 9 Nov 2016 06:34:52 +0800 Subject: [PATCH] Fix coverity defects: 154021 CID 154021: Null pointer dereference Reviewed-by: Giuseppe Di Natale Reviewed-by: Brian Behlendorf Signed-off-by: luozhengzheng Closes #5380 --- cmd/zed/agents/fmd_serd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/zed/agents/fmd_serd.c b/cmd/zed/agents/fmd_serd.c index 6143c5d7e1..043552862e 100644 --- a/cmd/zed/agents/fmd_serd.c +++ b/cmd/zed/agents/fmd_serd.c @@ -300,6 +300,9 @@ fmd_serd_eng_gc(fmd_serd_eng_t *sgp) return; /* no garbage collection needed if empty or fired */ sep = list_head(&sgp->sg_list); + if (sep == NULL) + return; + hrt = sep->se_hrt - sgp->sg_t; for (sep = list_head(&sgp->sg_list); sep != NULL; sep = nep) {