From patchwork Thu Feb 28 17:00:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10833479 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AB9AD17E9 for ; Thu, 28 Feb 2019 17:00:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B4E52F4C5 for ; Thu, 28 Feb 2019 17:00:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8FBB52F4F1; Thu, 28 Feb 2019 17:00:54 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=unavailable 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 58A2D2F4C5 for ; Thu, 28 Feb 2019 17:00:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C36796E21F; Thu, 28 Feb 2019 17:00:46 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5E0C46E21D for ; Thu, 28 Feb 2019 17:00:43 +0000 (UTC) Received: by mail-ed1-x543.google.com with SMTP id g9so17611573eds.3 for ; Thu, 28 Feb 2019 09:00:43 -0800 (PST) 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=GXWb4nT5m4dcHpi/mFEOsrAoVAmzTZjjW3BP1DcnelM=; b=fMD9pAaKJermvxgffkpiZ0LQmRrb7dgEi0TshOsDKkyqdMuV3PLqzYRbgsiglHqdIO zJU0TJJEbe5IetOA9eWEDu4MvOEX/2IIsGtjrGWoMVdahQ7v1Ej+Y5bt7+97mn5Wa4jV Rw0fjRT1CGSW6A43u1oggzYk4DIRPxVjGY+iJMOfSMHVA64lXg6j4XiawiY4gMO2gq58 oCzwooHjXOTGYi0vV1divikStz2LxhslaoOfnPQ/Sod7Oay0zPG2PCmzGpIvxQNBrmtt LBSUiSiU6bM5jEaG65KFTCXH9xXWXcXdIG1t69ayGxVDEnlJINvge97+NF2OsvMJPARL Ferg== X-Gm-Message-State: APjAAAVMX2bfle+/T4b7vQsZi9BPYe1yInXy9wOjbegRhGDKXxPDyv2B BP1H0dN+HLGdCpLAceEdXBhSuzgZCBt4AA== X-Google-Smtp-Source: APXvYqzgGxHgaHeb4cVPOKgOh04AkQQzYHHFwCEsSRxay5+FyAryukxCsDYvTmo7XdUjeUGSjbOEZw== X-Received: by 2002:a50:aa13:: with SMTP id o19mr504561edc.210.1551373241764; Thu, 28 Feb 2019 09:00:41 -0800 (PST) Received: from wespe.ffwll.local ([2a02:168:569e:0:7e01:304d:1991:69d]) by smtp.gmail.com with ESMTPSA id k26sm2070910edd.16.2019.02.28.09.00.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Feb 2019 09:00:40 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 1/7] drm/leases: Drop object_id validation for negative ids Date: Thu, 28 Feb 2019 18:00:28 +0100 Message-Id: <20190228170034.27660-2-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20190228170034.27660-1-daniel.vetter@ffwll.ch> References: <20190228170034.27660-1-daniel.vetter@ffwll.ch> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GXWb4nT5m4dcHpi/mFEOsrAoVAmzTZjjW3BP1DcnelM=; b=bIiAzT9a8WKIzsYBzthbJFCV2N4HjjdLYGxVpwormrGyZGygqV7iHR1ngd+V2YL+q1 7rH6ivhN5I2k85mDV5oE6ehvu68XAJKs16ONgrAoyE5AN9GuhRnXk8+FVkGiUGGEIA6S pIHTDL0SGij5yeVuVbfoSior4Zpjh0Ri6YpXM= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Intel Graphics Development , Keith Packard , Daniel Vetter MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Not exactly sure what's the aim here, but the canonical nil object has id == 0, we don't use negative object ids for anything. Plus all object_id are valided by the object_idr, there's nothing we need to do on top of that ENOENT check a bit further down. Spotted while typing exhaustive igt coverage for all these corner-cases. Cc: Keith Packard Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_lease.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c index 603b0bd9c5ce..1176d814cf7f 100644 --- a/drivers/gpu/drm/drm_lease.c +++ b/drivers/gpu/drm/drm_lease.c @@ -403,11 +403,6 @@ static int fill_object_idr(struct drm_device *dev, /* step one - get references to all the mode objects and check for validity. */ for (o = 0; o < object_count; o++) { - if ((int) object_ids[o] < 0) { - ret = -EINVAL; - goto out_free_objects; - } - objects[o] = drm_mode_object_find(dev, lessor_priv, object_ids[o], DRM_MODE_OBJECT_ANY);