Commit 3e340c05 authored by Jani Nikula's avatar Jani Nikula Committed by Roland Dreier

IB/cm: Fix device_create() return value check

Use IS_ERR() instead of comparing to NULL.
Signed-off-by: default avatarJani Nikula <ext-jani.1.nikula@nokia.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent b72c4094
...@@ -3693,7 +3693,7 @@ static void cm_add_one(struct ib_device *ib_device) ...@@ -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;
} }
......
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