[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cccfbd35-ddea-dd71-2538-7230d5f2b543@users.sourceforge.net>
Date: Sun, 11 Mar 2018 16:20:24 +0100
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: user-mode-linux-devel@...ts.sourceforge.net,
Anton Ivanov <anton.ivanov@...bridgegreys.com>,
Jeff Dike <jdike@...toit.com>,
Richard Weinberger <richard@....at>
Cc: user-mode-linux-user@...ts.sourceforge.net,
kernel-janitors@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH 5/9] um/drivers/vector_user: Delete two unnecessary checks
before freeaddrinfo() in user_init_socket_fds()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sun, 11 Mar 2018 14:20:46 +0100
The implementation returns from this function if a null pointer
was detected in the local variable "gairesult". Thus the check
before two calls of the function "freeaddrinfo" is not needed.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
arch/um/drivers/vector_user.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/arch/um/drivers/vector_user.c b/arch/um/drivers/vector_user.c
index e831bd85cad4..2dee1e183387 100644
--- a/arch/um/drivers/vector_user.c
+++ b/arch/um/drivers/vector_user.c
@@ -384,9 +384,7 @@ static struct vector_fds *user_init_socket_fds(struct arglist *ifspec, int id)
goto cleanup;
}
- if (gairesult != NULL)
- freeaddrinfo(gairesult);
-
+ freeaddrinfo(gairesult);
gairesult = NULL;
gairet = getaddrinfo(dst, dstport, &dsthints, &gairesult);
@@ -416,8 +414,7 @@ static struct vector_fds *user_init_socket_fds(struct arglist *ifspec, int id)
freeaddrinfo(gairesult);
return result;
cleanup:
- if (gairesult != NULL)
- freeaddrinfo(gairesult);
+ freeaddrinfo(gairesult);
if (fd >= 0)
os_close_file(fd);
--
2.16.2
Powered by blists - more mailing lists