From cf6120956a9e34121d2fa4924452672e16459ed2 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 11 Mar 2009 14:32:24 -0700 Subject: [PATCH] dpif: Fix fd leak in dpif_create(). --- lib/dpif.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/dpif.c b/lib/dpif.c index c179fbda..0109cda4 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -176,8 +176,9 @@ dpif_create(const char *name, struct dpif *dpif) error = ioctl(dpif->fd, ODP_DP_CREATE, name) < 0 ? errno : 0; if (!error) { return 0; - } else if (error != EBUSY) { - dpif_close(dpif); + } + dpif_close(dpif); + if (error != EBUSY) { return error; } } -- 2.30.2