From: Phil Sutter Subject: [iproute PATCH 1/2] tc_util: Drop needless pointer check Date: Wed, 15 Nov 2017 15:01:30 +0100 Message-ID: <20171115140131.15397-2-phil@nwl.cc> References: <20171115140131.15397-1-phil@nwl.cc> Cc: netdev@vger.kernel.org To: Stephen Hemminger Return-path: Received: from orbyte.nwl.cc ([151.80.46.58]:57604 "EHLO orbyte.nwl.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757993AbdKOOBx (ORCPT ); Wed, 15 Nov 2017 09:01:53 -0500 In-Reply-To: <20171115140131.15397-1-phil@nwl.cc> Sender: netdev-owner@vger.kernel.org List-ID: 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 --- 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