From: Florin Malita <[EMAIL PROTECTED]>

The skb allocation may fail, which can result in a NULL pointer dereference
in irlap_queue_xmit().

Coverity CID: 434.

davem: "If the allocation fails we should probably do something more
interesting here, such as schedule a timer to try again later.  Otherwise the
speed change will silently never occur."

Signed-off-by: Florin Malita <[EMAIL PROTECTED]>
Cc: Samuel Ortiz <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 net/irda/irlap.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -puN 
net/irda/irlap.c~irda-missing-allocation-result-check-in-irlap_change_speed 
net/irda/irlap.c
--- 
devel/net/irda/irlap.c~irda-missing-allocation-result-check-in-irlap_change_speed
   2006-06-01 20:31:50.000000000 -0700
+++ devel-akpm/net/irda/irlap.c 2006-06-01 20:31:50.000000000 -0700
@@ -884,7 +884,8 @@ static void irlap_change_speed(struct ir
        if (now) {
                /* Send down empty frame to trigger speed change */
                skb = dev_alloc_skb(0);
-               irlap_queue_xmit(self, skb);
+               if (skb)
+                       irlap_queue_xmit(self, skb);
        }
 }
 
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to