[1/4] cfgfile: remove dead code

Message ID 20240220035840.32978-2-fengchengwen@huawei.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series cfgfile: enhance error detecting |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

fengchengwen Feb. 20, 2024, 3:58 a.m. UTC
This memchr() will never return NULL because rte_cfgfile_load() function
will skip lines without useful content.

Fixes: 74e0d3a17461 ("cfgfile: fix null pointer dereference in parsing")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
 lib/cfgfile/rte_cfgfile.c | 6 ------
 1 file changed, 6 deletions(-)
  

Comments

Stephen Hemminger July 4, 2024, 9:28 p.m. UTC | #1
On Tue, 20 Feb 2024 03:58:37 +0000
Chengwen Feng <fengchengwen@huawei.com> wrote:

> This memchr() will never return NULL because rte_cfgfile_load() function
> will skip lines without useful content.
> 
> Fixes: 74e0d3a17461 ("cfgfile: fix null pointer dereference in parsing")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>

LGTM
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
  

Patch

diff --git a/lib/cfgfile/rte_cfgfile.c b/lib/cfgfile/rte_cfgfile.c
index 6a5e4fd942..d7aa38b56f 100644
--- a/lib/cfgfile/rte_cfgfile.c
+++ b/lib/cfgfile/rte_cfgfile.c
@@ -223,12 +223,6 @@  rte_cfgfile_load_with_params(const char *filename, int flags,
 
 			split[0] = buffer;
 			split[1] = memchr(buffer, '=', len);
-			if (split[1] == NULL) {
-				CFG_LOG(ERR,
-					"line %d - no '=' character found",
-					lineno);
-				goto error1;
-			}
 			*split[1] = '\0';
 			split[1]++;