* [patch] caif: remove unneeded null check in caif_connect()
@ 2010-05-22 20:43 Dan Carpenter
2010-05-24 19:56 ` Sjur Brændeland
[not found] ` <AANLkTikM6_-YgLcBtcxN_TA1ISHkRk6fCEJVOS7pRZel@mail.gmail.com>
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2010-05-22 20:43 UTC (permalink / raw)
To: Sjur Braendeland
Cc: Eric Dumazet, David S. Miller, linux-kernel, netdev,
kernel-janitors
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>
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c
index c3a70c5..bd67bb3 100644
--- a/net/caif/caif_socket.c
+++ b/net/caif/caif_socket.c
@@ -890,8 +890,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,
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [patch] caif: remove unneeded null check in caif_connect()
2010-05-22 20:43 [patch] caif: remove unneeded null check in caif_connect() Dan Carpenter
@ 2010-05-24 19:56 ` Sjur Brændeland
[not found] ` <AANLkTikM6_-YgLcBtcxN_TA1ISHkRk6fCEJVOS7pRZel@mail.gmail.com>
1 sibling, 0 replies; 3+ messages in thread
From: Sjur Brændeland @ 2010-05-24 19:56 UTC (permalink / raw)
To: Dan Carpenter, Sjur Braendeland, Eric Dumazet, David S. Miller,
linux-kernel
Dan Carpenter <error27@gmail.com> wrote:
> 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>
Thanks Looks good,
Acked-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] caif: remove unneeded null check in caif_connect()
[not found] ` <AANLkTikM6_-YgLcBtcxN_TA1ISHkRk6fCEJVOS7pRZel@mail.gmail.com>
@ 2010-05-31 7:32 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2010-05-31 7:32 UTC (permalink / raw)
To: sjurbren
Cc: error27, sjur.brandeland, eric.dumazet, linux-kernel, netdev,
kernel-janitors
From: Sjur Brændeland <sjurbren@gmail.com>
Date: Mon, 24 May 2010 21:56:01 +0200
> Dan Carpenter <error27@gmail.com> wrote:
>> 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>
> Thanks Looks good,
> Acked-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-05-31 7:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-22 20:43 [patch] caif: remove unneeded null check in caif_connect() Dan Carpenter
2010-05-24 19:56 ` Sjur Brændeland
[not found] ` <AANLkTikM6_-YgLcBtcxN_TA1ISHkRk6fCEJVOS7pRZel@mail.gmail.com>
2010-05-31 7:32 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).