* [PATCH net] net: bpfilter: Fix type cast and pointer warnings
@ 2018-10-05 15:27 Shanthosh RK
2018-10-05 18:51 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Shanthosh RK @ 2018-10-05 15:27 UTC (permalink / raw)
To: netdev, linux-kernel; +Cc: davem
Fixes the following Sparse warnings:
net/bpfilter/bpfilter_kern.c:62:21: warning: cast removes address space
of expression
net/bpfilter/bpfilter_kern.c:101:49: warning: Using plain integer as
NULL pointer
Signed-off-by: Shanthosh RK <shanthosh.rk@gmail.com>
---
net/bpfilter/bpfilter_kern.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/bpfilter/bpfilter_kern.c b/net/bpfilter/bpfilter_kern.c
index f0fc182d3db7..b64e1649993b 100644
--- a/net/bpfilter/bpfilter_kern.c
+++ b/net/bpfilter/bpfilter_kern.c
@@ -59,7 +59,7 @@ static int __bpfilter_process_sockopt(struct sock *sk, int optname,
req.is_set = is_set;
req.pid = current->pid;
req.cmd = optname;
- req.addr = (long)optval;
+ req.addr = (long __force __user)optval;
req.len = optlen;
mutex_lock(&bpfilter_lock);
if (!info.pid)
@@ -98,7 +98,7 @@ static int __init load_umh(void)
pr_info("Loaded bpfilter_umh pid %d\n", info.pid);
/* health check that usermode process started correctly */
- if (__bpfilter_process_sockopt(NULL, 0, 0, 0, 0) != 0) {
+ if (__bpfilter_process_sockopt(NULL, 0, NULL, 0, 0) != 0) {
stop_umh();
return -EFAULT;
}
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: bpfilter: Fix type cast and pointer warnings
2018-10-05 15:27 [PATCH net] net: bpfilter: Fix type cast and pointer warnings Shanthosh RK
@ 2018-10-05 18:51 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-10-05 18:51 UTC (permalink / raw)
To: shanthosh.rk; +Cc: netdev, linux-kernel
From: Shanthosh RK <shanthosh.rk@gmail.com>
Date: Fri, 5 Oct 2018 20:57:48 +0530
> Fixes the following Sparse warnings:
>
> net/bpfilter/bpfilter_kern.c:62:21: warning: cast removes address space
> of expression
> net/bpfilter/bpfilter_kern.c:101:49: warning: Using plain integer as
> NULL pointer
>
> Signed-off-by: Shanthosh RK <shanthosh.rk@gmail.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-05 18:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-05 15:27 [PATCH net] net: bpfilter: Fix type cast and pointer warnings Shanthosh RK
2018-10-05 18:51 ` David Miller
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 NNTP newsgroup(s).