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-Url: https://git.stricted.de/?a=commitdiff_plain;h=8c893ff6abbac0c7c05b1cb9bfb6e2dfc4538c75;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [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 7029618f5719..a16528657b4c 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); } }