linux-um.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: linux-um@lists.infradead.org
Cc: Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH 3/5] um: vector: fix bpfflash parameter evaluation
Date: Thu, 28 Mar 2024 10:06:36 +0100	[thread overview]
Message-ID: <20240328100640.1fe2aa1ac586.I9225b571409fd75485cacf2d9542efc630e997e9@changeid> (raw)
In-Reply-To: <20240328100640.d3ffb37dc64b.I2e2e713d6a78ea24e6508db9d3ef2882b88861da@changeid>

From: Johannes Berg <johannes.berg@intel.com>

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>
---
 arch/um/drivers/vector_kern.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
index dc2feae789cb..63e5f108a6b9 100644
--- a/arch/um/drivers/vector_kern.c
+++ b/arch/um/drivers/vector_kern.c
@@ -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;
 }
-- 
2.44.0



  parent reply	other threads:[~2024-03-28  9:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28  9:06 [PATCH 1/5] um: signal: move pid variable where needed Johannes Berg
2024-03-28  9:06 ` [PATCH 2/5] um: slirp: remove set but unused variable 'pid' Johannes Berg
2024-03-28  9:06 ` Johannes Berg [this message]
2024-03-28  9:06 ` [PATCH 4/5] um: vector: remove unused len variable/calculation Johannes Berg
2024-03-28  9:06 ` [PATCH 5/5] um: process: remove unused 'n' variable Johannes Berg
2024-03-29  4:20 ` [PATCH 1/5] um: signal: move pid variable where needed Tiwei Bie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240328100640.1fe2aa1ac586.I9225b571409fd75485cacf2d9542efc630e997e9@changeid \
    --to=johannes@sipsolutions.net \
    --cc=johannes.berg@intel.com \
    --cc=linux-um@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).