From patchwork Fri May 12 19:00:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 9724837 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EC840600CB for ; Fri, 12 May 2017 19:35:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2BD62888A for ; Fri, 12 May 2017 19:35:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7CB82888D; Fri, 12 May 2017 19:35:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A41DA2888A for ; Fri, 12 May 2017 19:35:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5AB5E6E730; Fri, 12 May 2017 19:34:44 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x243.google.com (mail-lf0-x243.google.com [IPv6:2a00:1450:4010:c07::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 32C996E1EA for ; Fri, 12 May 2017 19:01:40 +0000 (UTC) Received: by mail-lf0-x243.google.com with SMTP id h4so823187lfj.3 for ; Fri, 12 May 2017 12:01:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EMPFsoD7QFW7z6QPLRKpSYMv7EbznZeGjd/ORfpfBYE=; b=lFNM/hdZw4N4hZ5JW3d4EzxqfUIRd+Cu7jL1lKvpPZgUOHn9bIZb50jwPab2egAYiK JW4Qnl6it5inv3cOlLsuBu+uyM+t/AwCU7OdL2fDqywkiIAAlfV+jMS/3W93eNDysihJ Dum4y55Oy3RYWvmV9kMU5jmN80m1wGmZc2Vc37vAYLAkbJUWogejEUlGbctLAQ4nQ9nD vUdvBMT/Uba6auoZ11LDJN9xgOibfYVYeIP0MnNLfjK0O29NaoWwPgt1ozkEWOhD1Jyr nuxRym2goCgdXczV5X9ZQC63gwxapO2LPDQRUpZWD5bbnc3mqSIUgNxSbUIO3ZaWMz06 4GoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EMPFsoD7QFW7z6QPLRKpSYMv7EbznZeGjd/ORfpfBYE=; b=c6VSGUsamfGNxWxFnsQbhqRJt06EBsYLG7T/lNjxF0N8KVM+bMkkswei0clzP9+df1 FdHr4AtN7yCro/oDpJE/ArHTQkL8u4XqYLXVupNuBuaotlJwyK1hQCBOXgi1cTjOngUH 46Ae0b9Dk5XiXB6AzyTQVTx5NhFZgUFLScHXnIGU4aP8vZSX+u5N3s1q53BW7Gpq71Jx u/V2Yak0EvWII6Tib7FvVBrWexTvO/cHjtuuD9hJnQb2pqhiyVZ1GZ+xLsYLUvrEyUse Xol7Gwg97KL6bnBITNkV8kAgLiDXGA9ZOt3jkkWZH4s9tnMYYT9l+j0jc7dG8zUGvTMf 8b3A== X-Gm-Message-State: AODbwcAudrj393LkH8HsHbEpBCy2X8KVq+/qTZ4q3EFsJw51zKzyw5Kq VLCv5QBLqRCmbg== X-Received: by 10.25.235.210 with SMTP id f79mr1850540lfk.27.1494615698547; Fri, 12 May 2017 12:01:38 -0700 (PDT) Received: from localhost.localdomain (ppp109-252-91-175.pppoe.spdop.ru. [109.252.91.175]) by smtp.gmail.com with ESMTPSA id f25sm418298ljb.65.2017.05.12.12.01.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 May 2017 12:01:38 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding Subject: [PATCH 2/3] drm/tegra: Correct idr_alloc() minimum id Date: Fri, 12 May 2017 22:00:44 +0300 Message-Id: <20170512190044.17541-2-digetx@gmail.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170512190044.17541-1-digetx@gmail.com> References: <20170512190044.17541-1-digetx@gmail.com> X-Mailman-Approved-At: Fri, 12 May 2017 19:34:31 +0000 Cc: linux-tegra@vger.kernel.org, DRI Development X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The start = 0 is invalid and causes weird CDMA channel timeouts, presumably some memory misuse/corruption is going on. Fixes: bdd2f9cd10eb ("drm/tegra: Don't leak kernel pointer to userspace") Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/tegra/drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index 768750226452..732c8d98044f 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -518,7 +518,7 @@ static int tegra_client_open(struct tegra_drm_file *fpriv, if (err < 0) return err; - err = idr_alloc(&fpriv->contexts, context, 0, 0, GFP_KERNEL); + err = idr_alloc(&fpriv->contexts, context, 1, 0, GFP_KERNEL); if (err < 0) { client->ops->close_channel(context); return err;