Commit dc854914 authored by Lyude Paul's avatar Lyude Paul Committed by Ben Skeggs
Browse files

drm/nouveau: Check backlight IDs are >= 0, not > 0



Remember, ida IDs start at 0, not 1!

Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
Reviewed-by: default avatarKarol Herbst <kherbst@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 62e681f7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ nv40_backlight_init(struct drm_connector *connector)
				       &nv40_bl_ops, &props);

	if (IS_ERR(bd)) {
		if (bl_connector.id > 0)
		if (bl_connector.id >= 0)
			ida_simple_remove(&bl_ida, bl_connector.id);
		return PTR_ERR(bd);
	}
@@ -249,7 +249,7 @@ nv50_backlight_init(struct drm_connector *connector)
				       nv_encoder, ops, &props);

	if (IS_ERR(bd)) {
		if (bl_connector.id > 0)
		if (bl_connector.id >= 0)
			ida_simple_remove(&bl_ida, bl_connector.id);
		return PTR_ERR(bd);
	}