Commit 5b49b35a authored by Dan Carpenter's avatar Dan Carpenter Committed by John W. Linville

b43: check for allocation failures

Add some error handling if the allocation fails.
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 287546df
...@@ -83,7 +83,11 @@ void b43_bus_ssb_block_write(struct b43_bus_dev *dev, const void *buffer, ...@@ -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 *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->bus_type = B43_BUS_SSB;
dev->sdev = sdev; dev->sdev = sdev;
......
...@@ -5025,6 +5025,8 @@ int b43_ssb_probe(struct ssb_device *sdev, const struct ssb_device_id *id) ...@@ -5025,6 +5025,8 @@ int b43_ssb_probe(struct ssb_device *sdev, const struct ssb_device_id *id)
int first = 0; int first = 0;
dev = b43_bus_dev_ssb_init(sdev); dev = b43_bus_dev_ssb_init(sdev);
if (!dev)
return -ENOMEM;
wl = ssb_get_devtypedata(sdev); wl = ssb_get_devtypedata(sdev);
if (!wl) { if (!wl) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment