From: Ben Pfaff Date: Wed, 11 Mar 2009 21:32:50 +0000 (-0700) Subject: dpif: More consistently initialize dpifs in failure cases. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=081806d42ed673d4ef773b318c9c7fca6d6aa7f1;p=openvswitch dpif: More consistently initialize dpifs in failure cases. --- 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;