* [patch 14/17] irda: missing allocation result check in irlap_change_speed()
@ 2006-06-02 3:32 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2006-06-02 3:32 UTC (permalink / raw)
To: davem; +Cc: netdev, akpm, fmalita, samuel
From: Florin Malita <fmalita@gmail.com>
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 <fmalita@gmail.com>
Cc: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---
net/irda/irlap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff -puN net/irda/irlap.c~irda-missing-allocation-result-check-in-irlap_change_speed net/irda/irlap.c
--- devel/net/irda/irlap.c~irda-missing-allocation-result-check-in-irlap_change_speed 2006-06-01 20:31:50.000000000 -0700
+++ devel-akpm/net/irda/irlap.c 2006-06-01 20:31:50.000000000 -0700
@@ -884,7 +884,8 @@ static void irlap_change_speed(struct ir
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);
}
}
_
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-06-02 3:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-02 3:32 [patch 14/17] irda: missing allocation result check in irlap_change_speed() akpm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox