From: Rafał Miłecki Date: Thu, 4 Feb 2010 12:11:54 +0000 (+0100) Subject: b43: N-PHY: handle allocation fail in samples generation X-Git-Tag: MMI-PSA29.97-13-9~24841^2~49^2~95 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=40bd5203ddb6b946b55c35d1c26dfe9ec1b232f5;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git b43: N-PHY: handle allocation fail in samples generation Signed-off-by: Rafał Miłecki Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index 074b34c3b383..795bb1e3345d 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c @@ -1069,6 +1069,10 @@ static u16 b43_nphy_gen_load_samples(struct b43_wldev *dev, u32 freq, u16 max, } samples = kzalloc(len * sizeof(struct b43_c32), GFP_KERNEL); + if (!samples) { + b43err(dev->wl, "allocation for samples generation failed\n"); + return 0; + } rot = (((freq * 36) / bw) << 16) / 100; angle = 0;