Skip to content

Commit f5d72af

Browse files
error27davem330
authored andcommitted
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 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>
1 parent 024cb8a commit f5d72af

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎net/caif/caif_socket.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -874,8 +874,7 @@ static int caif_connect(struct socket *sock, struct sockaddr *uaddr,
874874
sk_stream_kill_queues(&cf_sk->sk);
875875

876876
err = -EINVAL;
877-
if (addr_len != sizeof(struct sockaddr_caif) ||
878-
!uaddr)
877+
if (addr_len != sizeof(struct sockaddr_caif))
879878
goto out;
880879

881880
memcpy(&cf_sk->conn_req.sockaddr, uaddr,

0 commit comments

Comments
 (0)