Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3057080imu; Mon, 19 Nov 2018 10:00:02 -0800 (PST) X-Google-Smtp-Source: AJdET5coawna6Yr1qA03NGGFHcTlmLWfxT/HYJNposcyRzt393HMafcJCx01qJ/tp3DbI+jtxBnh X-Received: by 2002:a63:1f4e:: with SMTP id q14mr20201116pgm.88.1542650402847; Mon, 19 Nov 2018 10:00:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542650402; cv=none; d=google.com; s=arc-20160816; b=Xn9AVUq9qxIuwAw0SPwbBypjeN7NsLo14qj4YdkhYhWQdgr6A6HS7ZZhLAMgE3ZCXI NQTPxd/FmGuiq5SoiieF8SORspkBAhO8jbICrPow7KvcxFd8ZUf1By3wn5WBoFVPlQAM eRqHKrMxW37JIbcgIIxd7Htd2ZgE3XEXZbect0V1Dxaac5nBzbRD2cr3pudVcMTuCXxE WVfxdwTgWmUAUGAthvVmtT7aVMdgjcn7vveQcvGgKw6zYh5jB9LD+DkP+5VSNRq+8fXK LgX2qE+1DSCtEeRvCS9DXH1k3VPcuPgJRQjio950sKlPCaCsR0njeccIy9yVAteWb+1/ Ol7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SpUq/XaNYQW/IQTe6kWirnZ65E6zIySyvKpZL+RKJck=; b=bB2tRS88R5IB7P2aVc+XMygHyCfRlSoVwMCuT0ljcwPNsuscwbHNKeN8zMVsRyLUSn WCTxB9rrYc34aPffysuSqeU8SwTzTr8t5pN9sBrepBFjHPTZn8SMJYtEmLOvt8Pg3ZFg D4FRxOqoUF374VkJo8okDRAmKcWTQfICYOOzg9euGbYh+zvfrVebFAzG5cac+uY4hoSX 9P0doCLGQSQDUu3ZJ/b5KNJJd4cQqOMLm2tkUklwBqjv9jMYQdWfAwD4xHqnv1t9TQWV sIDsgSWlOsdd/cbSFeNNKvEVgprj08r/IQ7dUbQDv2zfsymqg3DqwmxPZiwtHSSZ3EMN Lipw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pGHeq5Tq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u13si18725485plq.268.2018.11.19.09.59.48; Mon, 19 Nov 2018 10:00:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pGHeq5Tq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732374AbeKTDCL (ORCPT + 99 others); Mon, 19 Nov 2018 22:02:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:34362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732362AbeKTDCI (ORCPT ); Mon, 19 Nov 2018 22:02:08 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9F805208E4; Mon, 19 Nov 2018 16:37:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542645480; bh=U3HvkHMbd1ohvMKb8Sfdgs+HTlfnc37sAKPUF6yz544=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pGHeq5TquFmogrr1ey1mHyFVFLGlzunczM17LoMW6EibGswl7xTrYvALULzK58oog X74xUcegbbIE3W5QBWJf2g6YvDlM0LkEnJ8M8zQM0GB/u3FLQVBvZuZfWwor2ZErxc bm6P6hr8XLzLLnN1RT91GC75dyvz+gkP1zrr2ueI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lyude Paul , Karol Herbst , Ben Skeggs Subject: [PATCH 4.19 177/205] drm/nouveau: Check backlight IDs are >= 0, not > 0 Date: Mon, 19 Nov 2018 17:28:04 +0100 Message-Id: <20181119162640.965146889@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119162616.586062722@linuxfoundation.org> References: <20181119162616.586062722@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lyude Paul commit dc854914999d5d52ac1b31740cb0ea8d89d0372e upstream. Remember, ida IDs start at 0, not 1! Signed-off-by: Lyude Paul Reviewed-by: Karol Herbst Cc: stable@vger.kernel.org Signed-off-by: Ben Skeggs Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/nouveau/nouveau_backlight.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c @@ -116,7 +116,7 @@ nv40_backlight_init(struct drm_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 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); }