IB/cm: Fix device_create() return value check

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Friday, April 9, 2010 - 11:59 am

Gitweb:     http://git.kernel.org/linus/3e340c05c0def3bb68db6751299b7821c2ba0621
Commit:     3e340c05c0def3bb68db6751299b7821c2ba0621
Parent:     b72c40949b0f04728f2993a1434598d3bad094ea
Author:     Jani Nikula <ext-jani.1.nikula@nokia.com>
AuthorDate: Thu Mar 11 16:17:28 2010 +0000
Committer:  Roland Dreier <rolandd@cisco.com>
CommitDate: Wed Mar 31 14:26:52 2010 -0700

    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>
---
 drivers/infiniband/core/cm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 764787e..c9730cb 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -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;
 	}
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
IB/cm: Fix device_create() return value check, Linux Kernel Mailing ..., (Fri Apr 9, 11:59 am)