From d2f524295466567fb7ebfba60197f81bf220934b Mon Sep 17 00:00:00 2001 From: jhb Date: Thu, 14 Jun 2018 22:31:30 +0000 Subject: [PATCH] Exit with an error if a linker hints file can't be found. Continuing with a NULL hints variable just triggers a segfault later on. The other error cases in this function all exit for an error rather than warning. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D15579 --- sbin/devmatch/devmatch.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sbin/devmatch/devmatch.c b/sbin/devmatch/devmatch.c index 9c03179f7f4..a5b2af80fec 100644 --- a/sbin/devmatch/devmatch.c +++ b/sbin/devmatch/devmatch.c @@ -120,12 +120,8 @@ read_linker_hints(void) continue; break; } - if (q == NULL) { - warnx("Can't read linker hints file."); - free(hints); - hints = NULL; - return; - } + if (q == NULL) + errx(1, "Can't read linker hints file."); } else { hints = read_hints(linker_hints, &len); if (hints == NULL) -- 2.45.0