[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 <fmalita@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Florin Malita 2006-06-05 15:34:52 -07:00 committed by David S. Miller
parent 9bc18091a5
commit 8c893ff6ab
1 changed files with 2 additions and 1 deletions

View File

@ -884,7 +884,8 @@ static void irlap_change_speed(struct irlap_cb *self, __u32 speed, int now)
if (now) { if (now) {
/* Send down empty frame to trigger speed change */ /* Send down empty frame to trigger speed change */
skb = dev_alloc_skb(0); skb = dev_alloc_skb(0);
irlap_queue_xmit(self, skb); if (skb)
irlap_queue_xmit(self, skb);
} }
} }