[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20171115140131.15397-2-phil@nwl.cc>
Date: Wed, 15 Nov 2017 15:01:30 +0100
From: Phil Sutter <phil@....cc>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: netdev@...r.kernel.org
Subject: [iproute PATCH 1/2] tc_util: Drop needless pointer check
The function parse_action_control_slash() returns early if 'p' is NULL,
so after the first call to action_a2n(), 'p' is guaranteed not to be
NULL. Otherwise, the assignment '*p = 0' above would dereference the
NULL pointer already anyway, so just drop this check here.
Signed-off-by: Phil Sutter <phil@....cc>
---
tc/tc_util.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tc/tc_util.c b/tc/tc_util.c
index b39e5508235ed..b01362533cd56 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -631,8 +631,7 @@ int parse_action_control_slash(int *argc_p, char ***argv_p,
allow_num);
*p = 0;
if (action_a2n(*argv, &result1, allow_num)) {
- if (p)
- *p = '/';
+ *p = '/';
return -1;
}
--
2.13.1
Powered by blists - more mailing lists