]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
um: vector: fix bpfflash parameter evaluation
authorJohannes Berg <johannes.berg@intel.com>
Thu, 28 Mar 2024 09:06:36 +0000 (10:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jun 2024 11:39:43 +0000 (13:39 +0200)
[ Upstream commit 584ed2f76ff5fe360d87a04d17b6520c7999e06b ]

With W=1 the build complains about a pointer compared to
zero, clearly the result should've been compared.

Fixes: 9807019a62dc ("um: Loadable BPF "Firmware" for vector drivers")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Tiwei Bie <tiwei.btw@antgroup.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/um/drivers/vector_kern.c

index 45a4bcd27a39b018eca0441783f483c26df8824b..310fb14a85f771d05d466705a7c7bbb1d770d878 100644 (file)
@@ -141,7 +141,7 @@ static bool get_bpf_flash(struct arglist *def)
 
        if (allow != NULL) {
                if (kstrtoul(allow, 10, &result) == 0)
-                       return (allow > 0);
+                       return result > 0;
        }
        return false;
 }