mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-04 04:16:46 +07: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:
parent
b72c40949b
commit
3e340c05c0
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user