From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Wilson Subject: [PATCH v2 3/4] minios: clean up unneeded "err = NULL" in frontend drivers Date: Fri, 6 Sep 2013 12:52:06 -0700 Message-ID: <1378497127-809-4-git-send-email-msw@linux.com> References: <1378497127-809-1-git-send-email-msw@linux.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VI25E-00023F-5n for xen-devel@lists.xenproject.org; Fri, 06 Sep 2013 19:52:44 +0000 Received: by mail-pb0-f54.google.com with SMTP id ro12so3638856pbb.27 for ; Fri, 06 Sep 2013 12:52:40 -0700 (PDT) In-Reply-To: <1378497127-809-1-git-send-email-msw@linux.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ben Cressey , Matt Wilson , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org From: Ben Cressey 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 Reviewed-by: Matt Wilson Cc: Stefano Stabellini Acked-by: Samuel Thibault [msw: split a larger patch from Ben into this cleanup patch] Signed-off-by: Matt Wilson --- 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