Hello.

I'm locking /drivers/char/drm/(on last 2.6.11-bkX) and I
found some problems (bugs?)

in file drivers/char/drm/drm_ioctl.c :

/**
 * Setversion ioctl.
 *
 * \param inode device inode.
 * \param filp file pointer.
 * \param cmd command.
 * \param arg user argument, pointing to a drm_lock structure.
 * \return zero on success or negative number on failure.
 *
 * Sets the requested interface version
 */
int drm_setversion(DRM_IOCTL_ARGS)
(...)

        if (sv.drm_di_major != -1) {
                if (sv.drm_di_major != DRM_IF_MAJOR ||
                    sv.drm_di_minor < 0 || sv.drm_di_minor > DRM_IF_MINOR)
                        return EINVAL;



EINVAL is a positive number, so I think it should be
return -EINVAL (or change the description of return code)
[note: there are two "return EINVAL" in this function]


In the same function (drm_setversion)

                if (sv.drm_di_minor >= 1) {
                        /*
                         * Version 1.1 includes tying of DRM to specific device
                         */
                        drm_set_busid(dev);


why you don't check the errors code of "drm_set_busid(dev)" ?


In file drivers/char/drm/i915_dma.c, function i915_emit_box: return EFAULT; sould be return DRM_ERR(EFAULT); [i.e. negative value, as in return in the next few lines]


In drivers/char/drm/sis_mm.c the same (but with ENOMEM) in functions sis_fb_init and sis_ioctl_agp_init.


ciao cate



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to