提交 3e340c05 编写于 作者: J Jani Nikula 提交者: Roland Dreier

IB/cm: Fix device_create() return value check

Use IS_ERR() instead of comparing to NULL.
Signed-off-by: NJani Nikula <ext-jani.1.nikula@nokia.com>
Signed-off-by: NRoland Dreier <rolandd@cisco.com>
上级 b72c4094
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册