2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-22 20:23:57 +08:00

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:
Jani Nikula 2010-03-11 16:17:28 +00:00 committed by Roland Dreier
parent b72c40949b
commit 3e340c05c0

View File

@ -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;
}