diff options
author | Dan Carpenter <error27@gmail.com> | 2010-05-22 06:43:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-31 03:24:16 -0400 |
commit | f5d72af9f3dfea67f014f880d00665f96622f57f (patch) | |
tree | 9285fc7ee17a3f26dcbcce37ed2d79282fd254cc /net/caif | |
parent | 024cb8a67f3d3438322fac9d6f7b1cc578eca71c (diff) |
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 bece7b2398d0: "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: Dan Carpenter <error27@gmail.com>
Acked-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/caif')
-rw-r--r-- | net/caif/caif_socket.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c index 3d0e09584fae..791249316ef3 100644 --- a/net/caif/caif_socket.c +++ b/net/caif/caif_socket.c | |||
@@ -874,8 +874,7 @@ static int caif_connect(struct socket *sock, struct sockaddr *uaddr, | |||
874 | sk_stream_kill_queues(&cf_sk->sk); | 874 | sk_stream_kill_queues(&cf_sk->sk); |
875 | 875 | ||
876 | err = -EINVAL; | 876 | err = -EINVAL; |
877 | if (addr_len != sizeof(struct sockaddr_caif) || | 877 | if (addr_len != sizeof(struct sockaddr_caif)) |
878 | !uaddr) | ||
879 | goto out; | 878 | goto out; |
880 | 879 | ||
881 | memcpy(&cf_sk->conn_req.sockaddr, uaddr, | 880 | memcpy(&cf_sk->conn_req.sockaddr, uaddr, |