Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2729508pxb; Mon, 25 Apr 2022 00:42:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmx2H/fAq+lsU7F+bMxM/scvoSagQMvMQBuSXlR+yLEU2iKqMXt6qZ8oJBqVXWK5DArxXx X-Received: by 2002:a17:906:d54b:b0:6e7:f185:18d5 with SMTP id cr11-20020a170906d54b00b006e7f18518d5mr16090461ejc.155.1650872554373; Mon, 25 Apr 2022 00:42:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650872554; cv=none; d=google.com; s=arc-20160816; b=HE2AH05FSWEf8N5rVyWcGrb9rek8CSm2sazKmRpdFtw+r72/Xpdac3JwaGaAry3AOE +sZylBG8eAEdED+rI3kQz6eTLEV1NeaIJWtziabfZgDW5YGuoQKPP6GEzvUKYjrQLfNM zXon+eWz12Vbm3NgdPMFCWPY/WTNHwEGMOwj+mz9cRdDtGrmesq/Lu66Hl9qNFadOgX4 RWuz9cSMJ6v/PaqJcDq9KSyM3jfOppSyKjNA3QHzelRE2okR/cBAyaFfnMJ9Y1uiy86Z ES/FWcHiPJ1UVjT32g5s7kvsScVWHHYmCZEi7iDig1UlcQ0ZpX5t4fCdb1BygOctIYCp hT9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xH8fpuGDx8ZbVQDAdUtKbv5UCDUKOdTkUM7sOBxrsIM=; b=Ovqp9T2LiNzhbU4ZRkBwL7jXmqsUxPXSr2ZmrFJKosT+vdVYj1MBvj5Fe5hcjoSXOU Bhgh2f9dT6nwGcjqL+6KXJWyaMVXX8IfjVE652TkfsMC62hD0K84c8JTK5wL938a5bln 8/mOimHIiH603klQ7sjONadAVmp1p28ec0VRhBaBcbA3Hx05BNjjlsxwsZR/UU6SOj+j TCuJ5ryOrBdrWGRfW5gl9p4Mrhgd8t6+/Gv4aOLknnfAgE0m9EEI72bU4R5fDS1xqJGs vdo3X7Gn+Edh7Dp7XZZ6yieDblzE996kQd/YFxLB1FQi7aiuX//2xFS4Oa/TX/z+BWl6 y3Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=SSgxi5gT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g9-20020a50ee09000000b00425e2880b75si2501909eds.311.2022.04.25.00.42.10; Mon, 25 Apr 2022 00:42:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=SSgxi5gT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237566AbiDXTHy (ORCPT + 99 others); Sun, 24 Apr 2022 15:07:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237589AbiDXTHj (ORCPT ); Sun, 24 Apr 2022 15:07:39 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E0AF13977C for ; Sun, 24 Apr 2022 12:04:36 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id 4924D1F4065F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1650827075; bh=lhIfNUJOR+nfmdpbizX2v1sPc4G/RBRenNvxpsrr5ps=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SSgxi5gTDPsbwqj3S8FS6JR87X6ArOk1WQ04ZdPXubrgGmRt4/nBe8QXJZrSya0ZJ 9fVXZwDePk9CZeZDRI1wZKEHgtmOZYZuljgHrABV8Ew3TMLRBeiG3qt26uxnYVIbvt k5XbONcAh/wxl7I0OneAMqeog6v5KlPq4NkMA487HRO4wMuwfE9JNOQGkiEnN2ChAR Q64OUwS03AGYGQVic/yF288hGD8dLCceAahPfbxHsbMKUYCowV4khcdgOa/Jt1ia95 7LDM+hxtEq/+vpdKr/dKttlCnOEUctIj2P8Hy2Dm4Qlp7AF9IqzecSjuMqgZXX/NsU xkC4xgEy4HCEQ== From: Dmitry Osipenko To: David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Daniel Almeida , Gert Wollny , Gustavo Padovan , Daniel Stone , Tomeu Vizoso , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Steven Price , Alyssa Rosenzweig , Rob Clark , Emil Velikov , Robin Murphy , Qiang Yu , Sumit Semwal , =?UTF-8?q?Christian=20K=C3=B6nig?= Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Dmitry Osipenko , Dmitry Osipenko Subject: [PATCH v5 01/17] drm/panfrost: Put mapping instead of shmem obj on panfrost_mmu_map_fault_addr() error Date: Sun, 24 Apr 2022 22:04:08 +0300 Message-Id: <20220424190424.540501-2-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220424190424.540501-1-dmitry.osipenko@collabora.com> References: <20220424190424.540501-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When panfrost_mmu_map_fault_addr() fails, the BO's mapping should be unreferenced and not the shmem object that backs that mapping. Cc: stable@vger.kernel.org Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/panfrost/panfrost_mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c index d3f82b26a631..b285a8001b1d 100644 --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c @@ -518,7 +518,7 @@ static int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as, err_pages: drm_gem_shmem_put_pages(&bo->base); err_bo: - drm_gem_object_put(&bo->base.base); + panfrost_gem_mapping_put(bomapping); return ret; } -- 2.35.1