From patchwork Tue Feb 12 22:08:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 2132421 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 73B19DFB7B for ; Tue, 12 Feb 2013 22:11:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 45827E5C6C for ; Tue, 12 Feb 2013 14:11:19 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f46.google.com (mail-ee0-f46.google.com [74.125.83.46]) by gabe.freedesktop.org (Postfix) with ESMTP id ABC4FE5EFB for ; Tue, 12 Feb 2013 14:08:45 -0800 (PST) Received: by mail-ee0-f46.google.com with SMTP id e49so293953eek.19 for ; Tue, 12 Feb 2013 14:08:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=dbDV+SNxtgYbb1cHgCxDA6SdYaQ7FDBQVjxwJPaow58=; b=Z5zjYh22LmTZTCMcZUQhRGaugn9wHaofvK1Qq2VMB9ol+2APLXXrzkuOZbR3pMVzEI uM2OZtessykOjrcJqfMYluRg3cWtNiIPymy6hEHEJV9I0wdRMzKl8XhGT9doZtC0fee2 precUTiVj3n7P38/H4AyUa/g9xEEZGJLN+JkVIbs0hhqnLzbg4OTcM+OEIpQ+2q7SlGd evF+4fTmhGiNZh3R+JWq9q+qU5cqktqwkIVE1zs7VSqGP7iH3z6OVeAkSGkEPSVyhFu+ cWrJ3ofdTLBQqLlUpOgpzzMJTvy36ei8qEwKqKX5gUb8m3L5Yowl34lkN4t390aFznRj YPpA== X-Received: by 10.14.219.5 with SMTP id l5mr68193417eep.7.1360706924678; Tue, 12 Feb 2013 14:08:44 -0800 (PST) Received: from bellona.site ([178.22.112.2]) by mx.google.com with ESMTPS id a1sm44773462eep.2.2013.02.12.14.08.42 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Feb 2013 14:08:43 -0800 (PST) Message-ID: <511ABD69.3060201@suse.cz> Date: Tue, 12 Feb 2013 23:08:41 +0100 From: Jiri Slaby User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20130124 Thunderbird/19.0 MIME-Version: 1.0 To: Tejun Heo Subject: Re: compositing broken in -next (idr bug) References: <511ABA59.9050604@suse.cz> <511ABC32.3050706@suse.cz> In-Reply-To: <511ABC32.3050706@suse.cz> X-Enigmail-Version: 1.6a1pre Cc: Andrew Morton , LKML , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org On 02/12/2013 11:03 PM, Jiri Slaby wrote: > On 02/12/2013 10:55 PM, Jiri Slaby wrote: >> --- a/drivers/gpu/drm/drm_gem.c >> +++ b/drivers/gpu/drm/drm_gem.c >> @@ -453,7 +453,8 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data, >> spin_lock(&dev->object_name_lock); >> if (!obj->name) { >> ret = idr_alloc(&dev->object_name_idr, obj, 1, 0, >> GFP_NOWAIT); >> - obj->name = ret; >> + if (ret >= 0) >> + obj->name = ret; >> args->name = (uint64_t) obj->name; >> spin_unlock(&dev->object_name_lock); >> >> @@ -469,6 +470,7 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data, >> } >> >> err: >> + idr_preload_end(); >> drm_gem_object_unreference_unlocked(obj); >> return ret; > > Oh my, maybe: return ret < 0 ? ret : 0... Let's try. Bull's eye. --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -459,6 +459,7 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data, if (ret < 0) goto err; + ret = 0; /* Allocate a reference for the name table. */ drm_gem_object_reference(obj);