IB/cm: Fix device_create() return value check
Use IS_ERR() instead of comparing to NULL. Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
committed by
Roland Dreier
parent
b72c40949b
commit
3e340c05c0
@@ -3693,7 +3693,7 @@ static void cm_add_one(struct ib_device *ib_device)
|
|||||||
cm_dev->device = device_create(&cm_class, &ib_device->dev,
|
cm_dev->device = device_create(&cm_class, &ib_device->dev,
|
||||||
MKDEV(0, 0), NULL,
|
MKDEV(0, 0), NULL,
|
||||||
"%s", ib_device->name);
|
"%s", ib_device->name);
|
||||||
if (!cm_dev->device) {
|
if (IS_ERR(cm_dev->device)) {
|
||||||
kfree(cm_dev);
|
kfree(cm_dev);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user