Skip to content

Commit

Permalink
caif: remove unneeded null check in caif_connect()
Browse files Browse the repository at this point in the history
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 bece7b2: "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>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed May 31, 2010
1 parent 024cb8a commit f5d72af
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/caif/caif_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -874,8 +874,7 @@ static int caif_connect(struct socket *sock, struct sockaddr *uaddr,
sk_stream_kill_queues(&cf_sk->sk);

err = -EINVAL;
if (addr_len != sizeof(struct sockaddr_caif) ||
!uaddr)
if (addr_len != sizeof(struct sockaddr_caif))
goto out;

memcpy(&cf_sk->conn_req.sockaddr, uaddr,
Expand Down

0 comments on commit f5d72af

Please sign in to comment.