From 30684ac044bbb8e11ef100a24c01eb37ba7a8876 Mon Sep 17 00:00:00 2001 From: Chris Luke Date: Thu, 29 Mar 2018 12:56:58 -0700 Subject: Coverity fixes (VPP-1204) Minor bug fixes CID 183000: double close CID 180996: dead code CID 180995: NULL deref CID 181957: NULL deref CID 182676: NULL deref CID 182675: NULL deref Change-Id: Id35e391c95fafb8cd771984ee8a1a6e597056d37 Signed-off-by: Chris Luke --- src/vlib/linux/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/vlib/linux/pci.c') diff --git a/src/vlib/linux/pci.c b/src/vlib/linux/pci.c index 127d2ef167a..11480ca081c 100644 --- a/src/vlib/linux/pci.c +++ b/src/vlib/linux/pci.c @@ -919,8 +919,9 @@ error: { if (p->fd != -1) close (p->fd); - if (p->config_fd != -1) + if (p->config_fd != -1 && p->config_fd != p->fd) close (p->config_fd); + p->config_fd = p->fd = -1; } return err; } -- cgit 1.2.3-korg