lkml.org 
[lkml]   [2011]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] ATM, Solos PCI ADSL2+: Don't deref NULL pointer if net_ratelimit() and alloc_skb() interact badly.
From
From: Jesper Juhl <jj@chaosbits.net>
Date: Sun, 13 Feb 2011 21:49:32 +0100 (CET)

> If alloc_skb() fails to allocate memory and returns NULL then we want to
> return -ENOMEM from drivers/atm/solos-pci.c::popen() regardless of the
> value of net_ratelimit(). The way the code is today, we may not return if
> net_ratelimit() returns 0, then we'll proceed to pass a NULL pointer to
> skb_put() which will blow up in our face.
> This patch ensures that we always return -ENOMEM on alloc_skb() failure
> and only let the dev_warn() be controlled by the value of net_ratelimit().
>
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>

Applied.


\
 
 \ /
  Last update: 2011-02-14 01:57    [W:0.039 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site