caif: remove unneeded null check in caif_connect()
authorDan Carpenter <error27@gmail.com>
Sat, 22 May 2010 10:43:42 +0000 (10:43 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 31 May 2010 07:24:16 +0000 (00:24 -0700)
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>
net/caif/caif_socket.c

index 3d0e09584fae59611c1599503356eef19f7c0379..791249316ef3500f6f500400538e4360ccef33ac 100644 (file)
@@ -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,