提交 8c893ff6 编写于 作者: F Florin Malita 提交者: David S. Miller

[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: NFlorin Malita <fmalita@gmail.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 9bc18091
...@@ -884,7 +884,8 @@ static void irlap_change_speed(struct irlap_cb *self, __u32 speed, int now) ...@@ -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);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册