From: Florin Malita Date: Mon, 5 Jun 2006 22:34:52 +0000 (-0700) Subject: [IRDA]: Missing allocation result check in irlap_change_speed(). X-Git-Tag: v2.6.17-rc6~1^2~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c893ff6abbac0c7c05b1cb9bfb6e2dfc4538c75;p=linux-2.6 [IRDA]: Missing allocation result check in irlap_change_speed(). 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 Signed-off-by: Andrew Morton Signed-off-by: David S. Miller --- diff --git a/net/irda/irlap.c b/net/irda/irlap.c index 7029618f57..a16528657b 100644 --- a/net/irda/irlap.c +++ b/net/irda/irlap.c @@ -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); } }