From patchwork Thu Oct 15 07:36:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 7403561 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3E964BEEA4 for ; Thu, 15 Oct 2015 07:34:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 751ED207C6 for ; Thu, 15 Oct 2015 07:34:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1116020851 for ; Thu, 15 Oct 2015 07:34:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A40C47A10B; Thu, 15 Oct 2015 00:34:13 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by gabe.freedesktop.org (Postfix) with ESMTPS id CD4647A0F6 for ; Thu, 15 Oct 2015 00:34:05 -0700 (PDT) Received: by wijp11 with SMTP id p11so15493310wij.0 for ; Thu, 15 Oct 2015 00:34:04 -0700 (PDT) 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=rTKSXILKtW/hww7wvJthlBf0GUlcC6MNWHQWMn4NrP4=; b=JJMRZhOqBPotWY2s1jkQ7ScFO69cJZMWtPhpENANSAPkOnMmsQ+WF0QB+F/RIe6pHp EJl+qUuO+zdrnVK74YstCdrXsSRsSKBjbplXNTY+alKpwF90fKwtHNKdd7Ucnm0oWf0y TCzkvcnye8UAxlyoDSmNdF7SLtabrTrFxstsk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rTKSXILKtW/hww7wvJthlBf0GUlcC6MNWHQWMn4NrP4=; b=UMgEOYXs9xBiNZzzjqDc2F7QWG8I3c8tF6/Me6HVKHDFDYTyIIiWvh2bgMZHVw4Wk8 Gldvbq9WLjqS/juuAXhtR21jnTSGXdq06P823IwDIFa8xUrtqpCv/pEzR9THS4HAK2uC 1aUl9SLcdoxpMkHSpvJGmZQynotUSwNwekO7L8pzBd2nA6rXnTfx57/9eTbojwlxLB9Z paEUGCFCinmr3oPEDd3GmARCLAkQPRah41ZRMvDwH/6JEB/zWYSsIH/8Ah6QZdKnFMBv wKSYav27898wCGZAnXwAlpeKUCnwO6HAmuHJxmFKctQR+duy0Yw2NZZKTrRA78/ICZlB iivA== X-Gm-Message-State: ALoCoQmidc9kTFNTEQh/egVAUfL/A+nQcM6mZzZvKlKmMmTF25VuANDLof1QhWQ7KlrMayViokcy X-Received: by 10.194.246.102 with SMTP id xv6mr8821986wjc.58.1444894444606; Thu, 15 Oct 2015 00:34:04 -0700 (PDT) Received: from phenom.ffwll.local (212-51-149-109.fiber7.init7.net. [212.51.149.109]) by smtp.gmail.com with ESMTPSA id z4sm10201014wjz.29.2015.10.15.00.34.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Oct 2015 00:34:04 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 15/25] drm/gma500: Drop dev->struct_mutex from mmap offset function Date: Thu, 15 Oct 2015 09:36:31 +0200 Message-Id: <1444894601-5200-16-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.5.1 In-Reply-To: <1444894601-5200-1-git-send-email-daniel.vetter@ffwll.ch> References: <1444894601-5200-1-git-send-email-daniel.vetter@ffwll.ch> Cc: Daniel Vetter , Daniel Vetter 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-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Simply forgotten about this when I was doing my general cleansing of simple gem mmap offset functions. There's nothing but core functions called here, and they all have their own protection already. Signed-off-by: Daniel Vetter Signed-off-by: Patrik Jakobsson --- drivers/gpu/drm/gma500/gem.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/gma500/gem.c b/drivers/gpu/drm/gma500/gem.c index e3bdc8b1c32c..f0357f525f56 100644 --- a/drivers/gpu/drm/gma500/gem.c +++ b/drivers/gpu/drm/gma500/gem.c @@ -62,15 +62,10 @@ int psb_gem_dumb_map_gtt(struct drm_file *file, struct drm_device *dev, int ret = 0; struct drm_gem_object *obj; - mutex_lock(&dev->struct_mutex); - /* GEM does all our handle to object mapping */ obj = drm_gem_object_lookup(dev, file, handle); - if (obj == NULL) { - ret = -ENOENT; - goto unlock; - } - /* What validation is needed here ? */ + if (obj == NULL) + return -ENOENT; /* Make it mmapable */ ret = drm_gem_create_mmap_offset(obj); @@ -78,9 +73,7 @@ int psb_gem_dumb_map_gtt(struct drm_file *file, struct drm_device *dev, goto out; *offset = drm_vma_node_offset_addr(&obj->vma_node); out: - drm_gem_object_unreference(obj); -unlock: - mutex_unlock(&dev->struct_mutex); + drm_gem_object_unreference_unlocked(obj); return ret; }