drm: fix sysfs error path.
authorDave Airlie <airlied@redhat.com>
Tue, 2 Sep 2008 00:06:06 +0000 (10:06 +1000)
committerDave Airlie <airlied@linux.ie>
Fri, 17 Oct 2008 21:10:11 +0000 (07:10 +1000)
Pointed out by Roel Kluin on dri-devel.

Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_sysfs.c

index af211a0ef179defa1b2fb6c8de0d2acb14224389..1611b9bcbe7fd6378bc91a069ff8b8afab0d968b 100644 (file)
@@ -184,7 +184,7 @@ int drm_sysfs_device_add(struct drm_minor *minor)
 err_out_files:
        if (i > 0)
                for (j = 0; j < i; j++)
-                       device_remove_file(&minor->kdev, &device_attrs[i]);
+                       device_remove_file(&minor->kdev, &device_attrs[j]);
        device_unregister(&minor->kdev);
 err_out: