IB/cm: Fix device_create() return value check
[sfrench/cifs-2.6.git] / drivers / infiniband / core / cm.c
index 5130fc55b8e2739f001389d2392dfd8e49b96125..c9730cb3f695f0dc3f58e460038e586a0e0c6368 100644 (file)
@@ -3597,7 +3597,7 @@ static ssize_t cm_show_counter(struct kobject *obj, struct attribute *attr,
                       atomic_long_read(&group->counter[cm_attr->index]));
 }
 
-static struct sysfs_ops cm_counter_ops = {
+static const struct sysfs_ops cm_counter_ops = {
        .show = cm_show_counter
 };
 
@@ -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;
        }