]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[IRDA]: Missing allocation result check in irlap_change_speed().
authorFlorin Malita <fmalita@gmail.com>
Mon, 5 Jun 2006 22:34:52 +0000 (15:34 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Jun 2006 22:34:52 +0000 (15:34 -0700)
The skb allocation may fail, which can result in a NULL pointer dereference
in irlap_queue_xmit().

Coverity CID: 434.

Signed-off-by: Florin Malita <fmalita@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/irda/irlap.c

index 7029618f5719fa6659bd096c7d7a0345b29dff70..a16528657b4c6a0a7e584df36e051cdcff6706ec 100644 (file)
@@ -884,7 +884,8 @@ static void irlap_change_speed(struct irlap_cb *self, __u32 speed, int now)
        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);
        }
 }