提交 4fdb78d3 编写于 作者: A Andrew Morton 提交者: David S. Miller

net/ipv4/tcp.c: fix min() type mismatch warning

net/ipv4/tcp.c: In function 'do_tcp_setsockopt':
net/ipv4/tcp.c:2050: warning: comparison of distinct pointer types lacks a cast
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 28ad3957
...@@ -2047,7 +2047,7 @@ static int do_tcp_setsockopt(struct sock *sk, int level, ...@@ -2047,7 +2047,7 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
return -EINVAL; return -EINVAL;
val = strncpy_from_user(name, optval, val = strncpy_from_user(name, optval,
min(TCP_CA_NAME_MAX-1, optlen)); min_t(long, TCP_CA_NAME_MAX-1, optlen));
if (val < 0) if (val < 0)
return -EFAULT; return -EFAULT;
name[val] = 0; name[val] = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册