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>
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;
int first = 0;
dev = b43_bus_dev_ssb_init(sdev);
+ if (!dev)
+ return -ENOMEM;
wl = ssb_get_devtypedata(sdev);
if (!wl) {