From patchwork Thu Jan 19 23:20:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 13108955 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E7A36C004D4 for ; Thu, 19 Jan 2023 23:21:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=WVdFgvhaLTTsfiTCg0SQlyaYrhsE1CXoUtjN4ZqC3SI=; b=00UKrf7mQPugw6 /aKfiygXdVerEd/MROHrkgUxqCWFcONOJhICMizNxayoEymx92GqQdKnsqtulFHtFrR6eFPBQoX+E dbd3Az1Mk4py4imBr9CVANxMwuWnx/rRAB3SFKuVH3Y0x6VW7kSeVoU4XuGZrSNDFIbM8P9emlZim fbd+5Nm0Lo3UJhVmd/jSuppjZSqK8kWRlSIA89TqOMijgIZ7vuw15PevFqLkVSyVhe9tgdC0E9/bq gzzTytneZt6kvfhGQHYojZbYRyZwZG8I3FFavQnwhr///ZTGBghGMYSXr/TloxnUdPZ/eAmBIEcTj bVV1itYlHNYpZ04Zr4Sg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIeD6-007aYl-LY; Thu, 19 Jan 2023 23:20:44 +0000 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIeD3-007aWI-CH for linux-arm-kernel@lists.infradead.org; Thu, 19 Jan 2023 23:20:42 +0000 Received: by mail-pf1-x42e.google.com with SMTP id i65so2757119pfc.0 for ; Thu, 19 Jan 2023 15:20:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=/8VFYGKVQDx9YS3Bf+JaHr5ao9ClGu3C5S4SGB4QR9A=; b=SN+eVLi1DRWR6rpSY2PJV70czrUs98v9bI5D2abVAhBXs5JbxT/xeCGOi/5PrneIJv z8ts8tKo4C2kelodjYn8/A81cUlm28upoURRlm+J3SwgKIC01dXP2G9mlfR21jEHagOt AgdpBaAAlgbn1ztP2fKNvRA16SRAE6fd/KNyNSMEp3yG90WZUR6JdDwzIEuZ60GMMBIE 0XW8EH0lnzwVIF2gaOHYmtuS8/6EgJrt7pM2GPYjOpyq+cVDOixiF7Uz5YrybdLgs16/ FgdBrfm+RiuTgWcb7GVH3jUu5b05CKFys9IlL3fkrZvq7rmH07TFi4ZX/XR8GLWNyRjK HeGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/8VFYGKVQDx9YS3Bf+JaHr5ao9ClGu3C5S4SGB4QR9A=; b=KvoKg62oGhLZK1rRNkv7HV6gwt9gIuXyno1u8/hya7ORrzQ5Y2v3XLvjwNHiD1oUza K6S7+7ysnspbhZv/+ZFnHtvQR3QQWehS6lZONKRIbK3Lq55r92RWAqp0WQ9hRwPO4Om9 3negiqAdNRotUBpuwtN8zuKBM9HAFfUkBlblJIw5AkKoy1hqT6V/m++3S6BEMRfZOkYo iugAkdPs5mKSraBmtZFJtqX/f6v1w6FZnKmyNqN76BIh4jKAP/5Xu4GQBfv0abDUps82 2Q5zdi1NXzlFW/7qiVak5IM435Gbd7ZtsOOixV5iKH4D7ODgTEct/5va9jWc+CGpGruW 3e+w== X-Gm-Message-State: AFqh2kraFHArNUcb3s8g2cdu+UBsfTmVEiMvDlLrSQTF4x4k+HJah/Fw h4QF9JsjD0un16fFK5/cwUE= X-Google-Smtp-Source: AMrXdXurMgRBKbvVa+DeeN1KDnY9oIpSJ0B1l7OtzdgBetQn9I69jfzDhB7UqBrcd/mZIzoZShPITQ== X-Received: by 2002:aa7:8506:0:b0:58d:966b:2f63 with SMTP id v6-20020aa78506000000b0058d966b2f63mr11421708pfn.20.1674170432247; Thu, 19 Jan 2023 15:20:32 -0800 (PST) Received: from localhost ([2a00:79e1:abd:4a00:2703:3c72:eb1a:cffd]) by smtp.gmail.com with ESMTPSA id d8-20020aa797a8000000b0058837da69edsm21036005pfq.128.2023.01.19.15.20.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 15:20:31 -0800 (PST) From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: Rob Clark , Inki Dae , Seung-Woo Kim , Kyungmin Park , David Airlie , Daniel Vetter , Krzysztof Kozlowski , Alim Akhtar , linux-arm-kernel@lists.infradead.org (moderated list:ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES), linux-samsung-soc@vger.kernel.org (open list:ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] drm/exynos: Drop unbalanced obj unref Date: Thu, 19 Jan 2023 15:20:37 -0800 Message-Id: <20230119232037.2885568-1-robdclark@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230119_152041_443382_430C23E9 X-CRM114-Status: GOOD ( 11.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Rob Clark In the error path, exynos_drm_gem_mmap() was dropping an obj reference that it doesn't own. Fixes: 832316c704fe ("drm/exynos: use drm generic mmap interface") Signed-off-by: Rob Clark --- drivers/gpu/drm/exynos/exynos_drm_gem.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index 3e493f48e0d4..65bca61e63a3 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -363,7 +363,6 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv, static int exynos_drm_gem_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma) { struct exynos_drm_gem *exynos_gem = to_exynos_gem(obj); - int ret; if (obj->import_attach) return dma_buf_mmap(obj->dma_buf, vma, 0); @@ -383,16 +382,7 @@ static int exynos_drm_gem_mmap(struct drm_gem_object *obj, struct vm_area_struct vma->vm_page_prot = pgprot_noncached(vm_get_page_prot(vma->vm_flags)); - ret = exynos_drm_gem_mmap_buffer(exynos_gem, vma); - if (ret) - goto err_close_vm; - - return ret; - -err_close_vm: - drm_gem_vm_close(vma); - - return ret; + return exynos_drm_gem_mmap_buffer(exynos_gem, vma); } /* low-level interface prime helpers */