diff options
author | Dan Carpenter <error27@gmail.com> | 2011-06-09 10:09:34 +0300 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-06-10 14:57:53 -0400 |
commit | 5b49b35a671e59c16c33611ea2d5650438388663 (patch) | |
tree | d2d856567bfd58b9ac86651c586ded1731ef981d /drivers/net/wireless/b43/bus.c | |
parent | 287546df342daaa146c840ce26b3ed012a055de5 (diff) |
b43: check for allocation failures
Add some error handling if the allocation fails.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/bus.c')
-rw-r--r-- | drivers/net/wireless/b43/bus.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43/bus.c b/drivers/net/wireless/b43/bus.c index 6c63aecd6ab..8a10b82f8ea 100644 --- a/drivers/net/wireless/b43/bus.c +++ b/drivers/net/wireless/b43/bus.c @@ -83,7 +83,11 @@ void b43_bus_ssb_block_write(struct b43_bus_dev *dev, const void *buffer, struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev) { - struct b43_bus_dev *dev = kzalloc(sizeof(*dev), GFP_KERNEL); + struct b43_bus_dev *dev; + + dev = kzalloc(sizeof(*dev), GFP_KERNEL); + if (!dev) + return NULL; dev->bus_type = B43_BUS_SSB; dev->sdev = sdev; |