From: Ben Pfaff Date: Wed, 11 Mar 2009 21:32:24 +0000 (-0700) Subject: dpif: Fix fd leak in dpif_create(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf6120956a9e34121d2fa4924452672e16459ed2;p=openvswitch dpif: Fix fd leak in dpif_create(). --- 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; } }