On 5/17/06, Chris Lesiak <[EMAIL PROTECTED]> wrote:
This patch fixes the mishandling of the return values of class_create
and class_device_create in drivers/char/drm/drm_sys.c.  These two
functions do not return NULL on error.

--- linux-2.6/drivers/char/drm/drm_sysfs.c.orig
+++ linux-2.6/drivers/char/drm/drm_sysfs.c
@@ -45,7 +45,7 @@ struct class *drm_sysfs_create(struct mo
        struct class *class;

        class = class_create(owner, name);
-       if (!class)
+       if (IS_ERR(class))
                return class;

Shouldnt you also change this line to "return NULL;" or "return 0;"?


        class_create_file(class, &class_attr_version);
@@ -103,8 +103,8 @@ struct class_device *drm_sysfs_device_ad
                                        MKDEV(DRM_MAJOR, head->minor),
                                        &(head->dev->pdev)->dev,
                                        "card%d", head->minor);
-       if (!class_dev)
-               return NULL;
+       if (IS_ERR(class_dev))
+               return class_dev;

Same here


        class_set_devdata(class_dev, head);



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid7521&bid$8729&dat1642
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to