irda: missing allocation result check in irlap_change_speed()
Subsystems (2)
PATCH 14/17 irda: missing allocation result check in irlap_change_speed()
From: Florin Malita <[email protected]>
The skb allocation may fail, which can result in a NULL pointer dereference in irlap_queue_xmit().
Coverity CID: 434.
davem: "If the allocation fails we should probably do something more interesting here, such as schedule a timer to try again later. Otherwise the speed change will silently never occur."
Signed-off-by Florin Malita <[email protected]>
Cc Samuel Ortiz <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
net/irda/irlap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/irda/irlap.c renamed from net/irda/irlap.c~irda-missing-allocation-result-check-in-irlap_change_speed +2 -1
@@ -884,7 +884,8 @@ static void irlap_change_speed(struct irif (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); } }
_