From 081806d42ed673d4ef773b318c9c7fca6d6aa7f1 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 11 Mar 2009 14:32:50 -0700 Subject: [PATCH] dpif: More consistently initialize dpifs in failure cases. --- lib/dpif.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/dpif.c b/lib/dpif.c index 0109cda4..563149e4 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -149,7 +149,6 @@ dpif_create(const char *name, struct dpif *dpif) if (!get_minor_from_name(name, &minor)) { /* Minor was specified in 'name', go ahead and create it. */ - dpif->fd = -1; error = open_by_minor(minor, dpif); if (error) { return error; @@ -943,6 +942,8 @@ open_by_minor(unsigned int minor, struct dpif *dpif) char *fn; int fd; + dpif->minor = -1; + dpif->fd = -1; error = make_openflow_device(minor, &fn); if (error) { return error; -- 2.30.2