提交 83f04a7f 编写于 作者: L Lyude Paul 提交者: Greg Kroah-Hartman

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

commit dc854914999d5d52ac1b31740cb0ea8d89d0372e upstream.

Remember, ida IDs start at 0, not 1!
Signed-off-by: NLyude Paul <lyude@redhat.com>
Reviewed-by: NKarol Herbst <kherbst@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 c0845493
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册