Skip to content

Commit 3e340c0

Browse files
Jani NikulaRoland Dreier
authored andcommitted
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>
1 parent b72c409 commit 3e340c0

File tree

1 file changed

+1
-1
lines changed
  • drivers/infiniband/core

1 file changed

+1
-1
lines changed

drivers/infiniband/core/cm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3693,7 +3693,7 @@ static void cm_add_one(struct ib_device *ib_device)
36933693
cm_dev->device = device_create(&cm_class, &ib_device->dev,
36943694
MKDEV(0, 0), NULL,
36953695
"%s", ib_device->name);
3696-
if (!cm_dev->device) {
3696+
if (IS_ERR(cm_dev->device)) {
36973697
kfree(cm_dev);
36983698
return;
36993699
}

0 commit comments

Comments
 (0)