[PATCH fstools] partname: Correct fstools_partname_fallback_scan comparison

Brian Norris computersforpeace at gmail.com
Tue Jan 24 22:28:14 PST 2023


We want to return NULL if the param does *not* match 1 -- i.e., a
non-zero strcmp().

Fixes: 1ea5855e980c ("partname: Introduce fstools_partname_fallback_scan option")
Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---

 libfstools/partname.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libfstools/partname.c b/libfstools/partname.c
index f42322a49d5b..82c723c02097 100644
--- a/libfstools/partname.c
+++ b/libfstools/partname.c
@@ -143,7 +143,7 @@ static struct volume *partname_volume_find(char *name)
 		if (!get_var_from_file("/proc/cmdline", "fstools_partname_fallback_scan", rootparam, sizeof(rootparam)))
 			return NULL;
 
-		if (!strcmp("1", rootparam))
+		if (strcmp("1", rootparam))
 			return NULL;
 
 		/* no useful 'root=' kernel cmdline parameter, find on any block device */
-- 
2.39.0




More information about the openwrt-devel mailing list