wireless: ERR_PTR vs null
iwm_wdev_alloc() returns an ERR_PTR on failure and not null. It also prints its own dev_err() message so I removed that as well. Compile tested only. Sorry. Found by smatch (http://repo.or.cz/w/smatch.git). Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
45f5fa32b1
commit
2a21f86917
@@ -106,10 +106,8 @@ void *iwm_if_alloc(int sizeof_bus, struct device *dev,
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
wdev = iwm_wdev_alloc(sizeof_bus, dev);
|
wdev = iwm_wdev_alloc(sizeof_bus, dev);
|
||||||
if (!wdev) {
|
if (IS_ERR(wdev))
|
||||||
dev_err(dev, "no memory for wireless device instance\n");
|
return wdev;
|
||||||
return ERR_PTR(-ENOMEM);
|
|
||||||
}
|
|
||||||
|
|
||||||
iwm = wdev_to_iwm(wdev);
|
iwm = wdev_to_iwm(wdev);
|
||||||
iwm->bus_ops = if_ops;
|
iwm->bus_ops = if_ops;
|
||||||
|
Reference in New Issue
Block a user