From patchwork Wed Feb 19 10:20:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11390953 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 009A3930 for ; Wed, 19 Feb 2020 10:22:03 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D33DB2464E for ; Wed, 19 Feb 2020 10:22:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="QoaCQPR2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D33DB2464E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 35B5C6EB3A; Wed, 19 Feb 2020 10:21:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6D1E36EB35 for ; Wed, 19 Feb 2020 10:21:41 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id y11so27503484wrt.6 for ; Wed, 19 Feb 2020 02:21:41 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=r7QCkQeecG9kafjeTwFxIc7eZTrQc7j4K5sRgGQdigI=; b=QoaCQPR2ztg7b76dfjHiO9evENwhP19ZHSbNi27ipV+8WVhFaQr2PZSmyo8VBMiQYT 78iWk+vjNA0LAqHp1EG4cYoe7L92TtLYapTMpf0T3tQ2BhdDXX3hSbdsVFuKvRftXfbF eMAj7yn7CYfszBI5P304EgppceiWSDsWOxfOs= 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:mime-version:content-transfer-encoding; bh=r7QCkQeecG9kafjeTwFxIc7eZTrQc7j4K5sRgGQdigI=; b=DvpS+h/6rAfZQmh3dNMa4+JzIJ6HXUNBCS/ItYdpH4t+netIgglwipAekNeZAsSooU mgFDOYeCGKDnHyBAb2BReZ8mQzU9EtABDkeLS3RRgeXSmLPyEU3vkb5YMmyfrzMcGqzB UhZZijd6hGp3v+cmLg/ALmVpMDhyGdS6C83crF1HxxL5Yj5DODvAx9IrEKKvEgpS2R3F ekQJ5GQ3Ub4LpprKxKb4XiQxX2ik6nZR7kAffc0JWgwZUXul1+hg+9ybUSw0/BnE9B46 QjPv+oaZ+3x3v9G9tUVqwYEHgP+7O3JDTIPo0L06Rs8pqhW9omjUf3cxMJKYImEyJKBp 23NA== X-Gm-Message-State: APjAAAWIoII3zsl7l2oSgOhrCnDIapyz+ouPAGCigiGoYfzds+F1E8pY KdAdPdcZMxC6VqnteGFWgDVQGkIRVMc= X-Google-Smtp-Source: APXvYqwBXsZIAyeJd/WLgc6LlIvGApWTV56ZDFjc86v9Mjkff2StbKixXt5A1pf0P0ajeHog0GulRA== X-Received: by 2002:adf:eec3:: with SMTP id a3mr33084079wrp.337.1582107699768; Wed, 19 Feb 2020 02:21:39 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id s23sm2370339wra.15.2020.02.19.02.21.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 02:21:39 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 07/52] drm/udl: Use drmm_add_final_kfree Date: Wed, 19 Feb 2020 11:20:37 +0100 Message-Id: <20200219102122.1607365-8-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200219102122.1607365-1-daniel.vetter@ffwll.ch> References: <20200219102122.1607365-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sam Ravnborg , Daniel Vetter , Intel Graphics Development , Emil Velikov , Thomas Zimmermann , Daniel Vetter , Dave Airlie , Thomas Gleixner , Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" With this we can drop the final kfree from the release function. v2: We need drm_dev_put to unroll the driver creation (once drm_dev_init and drmm_add_final_kfree suceeded), otherwise the drmm_ magic doesn't happen. Signed-off-by: Daniel Vetter Cc: Dave Airlie Cc: Sean Paul Cc: Thomas Zimmermann Cc: Emil Velikov Cc: Daniel Vetter Cc: "Noralf Trønnes" Cc: Thomas Gleixner Cc: Sam Ravnborg --- drivers/gpu/drm/udl/udl_drv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/udl/udl_drv.c b/drivers/gpu/drm/udl/udl_drv.c index d5b89711ab1e..6a5594946096 100644 --- a/drivers/gpu/drm/udl/udl_drv.c +++ b/drivers/gpu/drm/udl/udl_drv.c @@ -81,8 +81,7 @@ static struct udl_device *udl_driver_create(struct usb_interface *interface) r = udl_init(udl); if (r) { - drm_dev_fini(&udl->drm); - kfree(udl); + drm_dev_put(&udl->drm); return ERR_PTR(r); }