Skip to content

Commit 33aa8da

Browse files
shanthoshdavem330
authored andcommitted
net: bpfilter: Fix type cast and pointer warnings
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]>
1 parent 2c05d88 commit 33aa8da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/bpfilter/bpfilter_kern.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static int __bpfilter_process_sockopt(struct sock *sk, int optname,
5959
req.is_set = is_set;
6060
req.pid = current->pid;
6161
req.cmd = optname;
62-
req.addr = (long)optval;
62+
req.addr = (long __force __user)optval;
6363
req.len = optlen;
6464
mutex_lock(&bpfilter_lock);
6565
if (!info.pid)
@@ -98,7 +98,7 @@ static int __init load_umh(void)
9898
pr_info("Loaded bpfilter_umh pid %d\n", info.pid);
9999

100100
/* health check that usermode process started correctly */
101-
if (__bpfilter_process_sockopt(NULL, 0, 0, 0, 0) != 0) {
101+
if (__bpfilter_process_sockopt(NULL, 0, NULL, 0, 0) != 0) {
102102
stop_umh();
103103
return -EFAULT;
104104
}

0 commit comments

Comments
 (0)