Skip to content

Commit

Permalink
IB/cm: Fix device_create() return value check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jani Nikula authored and Roland Dreier committed Mar 31, 2010
1 parent b72c409 commit 3e340c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/core/cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3693,7 +3693,7 @@ static void cm_add_one(struct ib_device *ib_device)
cm_dev->device = device_create(&cm_class, &ib_device->dev,
MKDEV(0, 0), NULL,
"%s", ib_device->name);
if (!cm_dev->device) {
if (IS_ERR(cm_dev->device)) {
kfree(cm_dev);
return;
}
Expand Down

0 comments on commit 3e340c0

Please sign in to comment.