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 <computersforpe...@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


_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to