From patchwork Wed Jul 17 13:07:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Egbert Eich X-Patchwork-Id: 2828598 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 16E289F967 for ; Wed, 17 Jul 2013 13:19:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E7032201BC for ; Wed, 17 Jul 2013 13:19:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 98352201B9 for ; Wed, 17 Jul 2013 13:19:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9174E4369A for ; Wed, 17 Jul 2013 06:19:26 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by gabe.freedesktop.org (Postfix) with ESMTP id 50855E5EC9 for ; Wed, 17 Jul 2013 06:07:59 -0700 (PDT) Received: from debian (p5DCF2FCF.dip0.t-ipconnect.de [93.207.47.207]) by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis) id 0MDgeU-1Uvby61Afm-00H5bL; Wed, 17 Jul 2013 15:07:48 +0200 Received: from sles11.fritz.box (sles11.fritz.box [192.168.178.22]) by debian (Postfix) with ESMTP id B87A413C76; Wed, 17 Jul 2013 15:07:46 +0200 (CEST) From: Egbert Eich To: dri-devel@lists.freedesktop.org Subject: [PATCH 04/16] drm/mgag200: Don't unreference when handle creation failed Date: Wed, 17 Jul 2013 15:07:17 +0200 Message-Id: <1374066449-21714-5-git-send-email-eich@suse.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1374066449-21714-1-git-send-email-eich@suse.com> References: <1374066449-21714-1-git-send-email-eich@suse.com> X-Provags-ID: V02:K0:pX9vNQ1HMJZji7511BsPYqtrCZQIEfSNNsma0PZaQTe uIvOe3ZsSn1rkIDPHwgK/16Eb5BQ5x0NEIrQCy89xTi2Y+d0H0 xaXXGg3wkQmNvltLglfEW+SC+ssgRB4X7HLgi9J45qYGULYUGh bbBWP6PrsR+piC9OH/bv8qXAFULbUfjDtA7/UyNZsTi/2hqqz6 ZwNs+Sxvc4dHnzcfEz7wQIRQeh9b5Q6RlEofFyCioHUvL2ydiu Mlej+sp1syol33ogHSKdLB4IClCKr6NbFf8PP2IxS0EWOlwiSG A5h9PKIx5HImqd1B5C4742S7tBcBeC0pFt4DfHwylImJeMUa32 SaVPPRBf/RqQW+5jJhEIiVNvbqc3gajunT5IwBYUC Cc: Dave Airlie , Christopher Harvey , Mathieu Larouche , Egbert Eich 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: , MIME-Version: 1.0 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 X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 drm_gem_handle_create() should not have referenced an object when it's creation has failed for some reason. Signed-off-by: Egbert Eich --- drivers/gpu/drm/mgag200/mgag200_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c index 43ebf8d..d51096c 100644 --- a/drivers/gpu/drm/mgag200/mgag200_main.c +++ b/drivers/gpu/drm/mgag200/mgag200_main.c @@ -302,10 +302,11 @@ int mgag200_dumb_create(struct drm_file *file, return ret; ret = drm_gem_handle_create(file, gobj, &handle); - drm_gem_object_unreference_unlocked(gobj); if (ret) return ret; + drm_gem_object_unreference_unlocked(gobj); + args->handle = handle; return 0; }