Commit f5d72af9 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

caif: remove unneeded null check in caif_connect()

We already dereferenced uaddr towards the start of the function when we
checked that "uaddr->sa_family != AF_CAIF".  Both the check here and the
earlier check were added in bece7b23: "caif: Rewritten socket
implementation".  Before that patch, we assumed that we recieved a valid
pointer for uaddr, and based on that, I have removed this check.
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Acked-by: default avatarSjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 024cb8a6
...@@ -874,8 +874,7 @@ static int caif_connect(struct socket *sock, struct sockaddr *uaddr, ...@@ -874,8 +874,7 @@ static int caif_connect(struct socket *sock, struct sockaddr *uaddr,
sk_stream_kill_queues(&cf_sk->sk); sk_stream_kill_queues(&cf_sk->sk);
err = -EINVAL; err = -EINVAL;
if (addr_len != sizeof(struct sockaddr_caif) || if (addr_len != sizeof(struct sockaddr_caif))
!uaddr)
goto out; goto out;
memcpy(&cf_sk->conn_req.sockaddr, uaddr, memcpy(&cf_sk->conn_req.sockaddr, uaddr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment