All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Wilson <msw@linux.com>
To: xen-devel@lists.xenproject.org
Cc: Ben Cressey <bcressey@amazon.com>, Matt Wilson <msw@amazon.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [PATCH v2 3/4] minios: clean up unneeded "err = NULL" in frontend drivers
Date: Fri,  6 Sep 2013 12:52:06 -0700	[thread overview]
Message-ID: <1378497127-809-4-git-send-email-msw@linux.com> (raw)
In-Reply-To: <1378497127-809-1-git-send-email-msw@linux.com>

From: Ben Cressey <bcressey@amazon.com>

This patch removes cases where the error message pointer is already
NULL and is then set to NULL. These are harmless, but suggest
incorrect practice: the pointer should be passed to free() to
deallocate memory prior to reassignment. There are no functional
changes in this patch.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
Reviewed-by: Matt Wilson <msw@amazon.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
[msw: split a larger patch from Ben into this cleanup patch]
Signed-off-by: Matt Wilson <msw@amazon.com>
---
 extras/mini-os/blkfront.c |    1 -
 extras/mini-os/fbfront.c  |    3 ---
 extras/mini-os/netfront.c |    1 -
 extras/mini-os/pcifront.c |    1 -
 4 files changed, 6 deletions(-)

diff --git a/extras/mini-os/blkfront.c b/extras/mini-os/blkfront.c
index 73837f6..dd5e95f 100644
--- a/extras/mini-os/blkfront.c
+++ b/extras/mini-os/blkfront.c
@@ -289,7 +289,6 @@ void shutdown_blkfront(struct blkfront_dev *dev)
                 XenbusStateInitialising, err);
         goto close;
     }
-    err = NULL;
     state = xenbus_read_integer(path);
     while (err == NULL && (state < XenbusStateInitWait || state >= XenbusStateClosed))
         err = xenbus_wait_for_state_change(path, &state, &dev->events);
diff --git a/extras/mini-os/fbfront.c b/extras/mini-os/fbfront.c
index 9148496..8b4466a 100644
--- a/extras/mini-os/fbfront.c
+++ b/extras/mini-os/fbfront.c
@@ -272,7 +272,6 @@ void shutdown_kbdfront(struct kbdfront_dev *dev)
                 XenbusStateInitialising, err);
         goto close_kbdfront;
     }
-    err = NULL;
     state = xenbus_read_integer(path);
     while (err == NULL && (state < XenbusStateInitWait || state >= XenbusStateClosed))
     err = xenbus_wait_for_state_change(path, &state, &dev->events);
@@ -664,8 +663,6 @@ void shutdown_fbfront(struct fbfront_dev *dev)
                 XenbusStateInitialising, err);
         goto close_fbfront;
     }
-
-    err = NULL;
     state = xenbus_read_integer(path);
     while (err == NULL && (state < XenbusStateInitWait || state >= XenbusStateClosed))
         err = xenbus_wait_for_state_change(path, &state, &dev->events);
diff --git a/extras/mini-os/netfront.c b/extras/mini-os/netfront.c
index 7947fc2..dc29f14 100644
--- a/extras/mini-os/netfront.c
+++ b/extras/mini-os/netfront.c
@@ -541,7 +541,6 @@ void shutdown_netfront(struct netfront_dev *dev)
                 XenbusStateInitialising, err);
         goto close;
     }
-    err = NULL;
     state = xenbus_read_integer(path);
     while (err == NULL && (state < XenbusStateInitWait || state >= XenbusStateClosed))
         err = xenbus_wait_for_state_change(path, &state, &dev->events);
diff --git a/extras/mini-os/pcifront.c b/extras/mini-os/pcifront.c
index e6a5f4e..df300b5 100644
--- a/extras/mini-os/pcifront.c
+++ b/extras/mini-os/pcifront.c
@@ -355,7 +355,6 @@ void shutdown_pcifront(struct pcifront_dev *dev)
                 XenbusStateInitialising, err);
         goto close_pcifront;
     }
-    err = NULL;
     state = xenbus_read_integer(path);
     while (err == NULL && (state < XenbusStateInitWait || state >= XenbusStateClosed))
         err = xenbus_wait_for_state_change(path, &state, &dev->events);
-- 
1.7.9.5

  parent reply	other threads:[~2013-09-06 19:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-05  0:25 [PATCH] minios: Fix xenbus_rm() calls in frontend drivers Matt Wilson
2013-09-05  9:17 ` Ian Campbell
2013-09-05 18:06   ` Matt Wilson
2013-09-06  9:00     ` Ian Campbell
2013-09-06 16:24       ` Matt Wilson
2013-09-06 16:53         ` Ian Campbell
2013-09-06 19:52           ` [PATCH v2 0/4] minios: various cleanups and fixes Matt Wilson
2013-09-06 19:52             ` [PATCH v2 1/4] minios: correct char array allocation for xenbus paths Matt Wilson
2013-09-09 14:00               ` Ian Campbell
2013-09-09 18:53               ` Samuel Thibault
2013-09-06 19:52             ` [PATCH v2 2/4] minios: clean up allocation of char arrays used " Matt Wilson
2013-09-09 14:02               ` Ian Campbell
2013-09-06 19:52             ` Matt Wilson [this message]
2013-09-06 19:52             ` [PATCH v2 4/4] minios: fix xenbus_rm() calls in frontend drivers Matt Wilson
2013-09-09 14:04             ` [PATCH v2 0/4] minios: various cleanups and fixes Ian Campbell
2013-09-10 10:48             ` Ian Campbell
2013-09-05 18:17 ` [PATCH] minios: Fix xenbus_rm() calls in frontend drivers Samuel Thibault

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1378497127-809-4-git-send-email-msw@linux.com \
    --to=msw@linux.com \
    --cc=bcressey@amazon.com \
    --cc=msw@amazon.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.