Skip to content

Commit

Permalink
[IRDA]: Missing allocation result check in irlap_change_speed().
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Florin Malita authored and David S. Miller committed Jun 5, 2006
1 parent 9bc1809 commit 8c893ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/irda/irlap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 8c893ff

Please sign in to comment.