lkml.org 
[lkml]   [2006]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] LLC: Avoid potential NULL dereference in net/llc/af_llc.c::llc_ui_accept() .
From
From: Jesper Juhl <jesper.juhl@gmail.com>
Date: Thu, 2 Nov 2006 01:21:53 +0100

> Since skb_dequeue() may return NULL we risk dereferencing a NULL pointer at
> if (!skb->sk)
> This patch avoids that by also testing for a NULL skb.
>
>
> Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>

It can't return NULL in this context because we just checked
skb_queue_empty() with the socket lock held and llc_wait_data()
will return zero only if skb_queue_empty() is false.

I know it's hard for automated tools to see this, but it's not
reasonable to put this extra check in there since it is
superfluous due to the above mentioned invariants.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-11-02 01:31    [W:0.384 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site