b43: N-PHY: handle allocation fail in samples generation
authorRafał Miłecki <zajec5@gmail.com>
Thu, 4 Feb 2010 12:11:54 +0000 (13:11 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 8 Feb 2010 21:50:56 +0000 (16:50 -0500)
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/b43/phy_n.c

index 074b34c3b38385ab3854b282a1450ab534e195c2..795bb1e3345dce2d4756520b875aba514a0c0782 100644 (file)
@@ -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;