Re: [PATCH] Bluetooth: Do not dereference zero sk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Tue, Feb 14, 2012, Marcel Holtmann wrote:
> > Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx>
> > ---
> >  net/bluetooth/l2cap_sock.c |    4 +++-
> >  1 files changed, 3 insertions(+), 1 deletions(-)
> > 
> > diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
> > index 1636029..138fe34 100644
> > --- a/net/bluetooth/l2cap_sock.c
> > +++ b/net/bluetooth/l2cap_sock.c
> > @@ -795,7 +795,7 @@ static void l2cap_sock_kill(struct sock *sk)
> >  static int l2cap_sock_shutdown(struct socket *sock, int how)
> >  {
> >  	struct sock *sk = sock->sk;
> > -	struct l2cap_chan *chan = l2cap_pi(sk)->chan;
> > +	struct l2cap_chan *chan;
> >  	int err = 0;
> >  
> >  	BT_DBG("sock %p, sk %p", sock, sk);
> > @@ -803,6 +803,8 @@ static int l2cap_sock_shutdown(struct socket *sock, int how)
> >  	if (!sk)
> >  		return 0;
> >  
> > +	chan = l2cap_pi(sk)->chan;
> > +
> 
> funny that this never caused any problems so far.
> 
> Acked-by: Marcel Holtmann <marcel@xxxxxxxxxxxx>

Applied to my bluetooth-next tree. Thanks.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux