Skip to content

Commit

Permalink
net: bpfilter: Fix type cast and pointer warnings
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
shanthosh authored and davem330 committed Oct 5, 2018
1 parent 2c05d88 commit 33aa8da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/bpfilter/bpfilter_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 33aa8da

Please sign in to comment.