Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp258894lqr; Wed, 5 Jun 2024 05:28:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXKAwRaiumLKNhhY68D7B6MhLH8UYxREtitKwftpCnwBy56/4Nar5xG13lPGVqyfBYK0FVYxSveYFoW8+BrOR3L0psePNx5ulkglwBiKg== X-Google-Smtp-Source: AGHT+IFoGskOgNH8kgXQlTq8yLWkUmPaq7buwnV2bggZKuxnZIChabF9WarX6fQOeOfQOtAd2J1m X-Received: by 2002:a17:907:601:b0:a69:20ba:43cd with SMTP id a640c23a62f3a-a699d63f706mr200634466b.26.1717590514325; Wed, 05 Jun 2024 05:28:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717590514; cv=pass; d=google.com; s=arc-20160816; b=pJhyFLrvxnWdtHOmCTP3s7N4LG+UrXNtV6knMZJi60nJifxmajMvEcouxqa/pzp6Mw 50p1D+FhQiJ1IQ/5A5RNie+0oGcYZkhlcCbykuIyqkWZAM340a7tlMRPUHWsANo0CskX Mv6jQjflWDpzBgrT61Sf3YYRhRLKUHNHhxHSWDBkqn/Wzk1S2HMINVRsujcPcVBfIQj9 lWsl5yBwgBLWLZgAeXd0aD7xAz3WcEngyp8FZVGv1/qjia4GzqC4w9wCPqpuSPtC8J1j b+WNEaRsc23N5yYTOQnuRMVacmZrP2udcHvsMzgqwCUBaTCtiMfd+/YKLzHbV2YcfV1r DH2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=hFenAdAu2l213rnY7KgUzc+F10WXEUqFSgA717S3A88=; fh=mNQEqJmIvnGt8rvN7gA30mIA2IgRJXMxPSGbzfcGC/Q=; b=jhNM5aGj6t32Fez5YKKzls4LwK6flA3sVDGYzY+YPTmSJTQzBCadPHsiDibgl9dgLe ZzW8ejM62RYcoMdn5Zmr0BZsaQQvglKtZSVe7gF9p76Hq+V1GmPbN14/Au8XEeK/lTFu /T2m1HTWKzx2+MCrPBPW99vMtCJUtQriIagemJqd4u47tmAxwcVCvsuD0pZo6TY9htjs 1EgCtK6bwa/xJ1QuQ9aUki/k/eFU8uG3c3PdMVBeIUeyK1XMvGRsKlLwjtttx7Pf4jpJ ExWVjavSMo4adg3nHeBtFg83OTP1BvzbUsAZZdj84TvVvYp9tY4Z8G3i1YbW5kVIgpU0 izHg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UzDezxIt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202452-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202452-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a690e85391csi306987366b.319.2024.06.05.05.28.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 05:28:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202452-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UzDezxIt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202452-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202452-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0C23E1F2152B for ; Wed, 5 Jun 2024 12:28:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A864F195FF2; Wed, 5 Jun 2024 12:02:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UzDezxIt" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBC07195FE4; Wed, 5 Jun 2024 12:02:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588944; cv=none; b=ESvfdkhPxLxC6Jh5H5R9MOZBNB/mCAt9/JdNH4CAd0MWcjjE/bvIkH1UsgdnQBMNKRrYTnTbeB966V15OAxrIMrbX+gcnDzDQB0S9JxpHwN3AJOIh25MqIREjF5jhhszItNRPh6pTrLpRlU2GvMMV+8WqedW0wIsEM5XpGSgsZ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588944; c=relaxed/simple; bh=HyWxOHBFsxYxuhl2IOENDQJf/JYMZt5KUEf88qktYTs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OZsch/1q1DR8L0LDwlEpesjGsyMLw0CK71bpwaRmumaskwAUpNwZtjXipX0AqKSi2J8h3AJfnSxPix7p2AA8FMu3uVUOknwAJbU3neMnYTQ1Gx19JJ+bBcfdJmA3BfgMxbARbUnhihGZneW2hifJajKeCNUEZSUjR0A1Qyp4HkI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UzDezxIt; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49EBBC32786; Wed, 5 Jun 2024 12:02:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717588944; bh=HyWxOHBFsxYxuhl2IOENDQJf/JYMZt5KUEf88qktYTs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UzDezxItsI+ktI6JycRMmKIqqXZrXWVegMJk0QoLEGryY0IoxhIjxPx40QPSzjIWr SSf57IiDX+BdbY2SybnvEjD1rWEWyeGQwZ6YllmC5UZZ52KGG7GvG68GguGa0D6i1q sT1irotU9wOTklOaKhCBcOS+yoUPXffElY8cHVK2alE+LThHjVyb33nD9heQvKiJBp mzVqwTwtwX43NsWg34Towiyka4w6kwKZ1f5uNXJdq/4to5yQVLcWIqPFnm5QfG3HSX sakM3ZsyY1K5iVWZEMn9kWduPFIzm+CVzbk3jsmD/2DPAr9uTkSYmrGsSHAx2U2vsM EwOsx+ftlSqTw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Fedor Pchelkin , Barry Song <21cnbao@gmail.com>, Robin Murphy , Christoph Hellwig , Sasha Levin , chenxiang66@hisilicon.com, m.szyprowski@samsung.com, iommu@lists.linux.dev Subject: [PATCH AUTOSEL 6.9 02/23] dma-mapping: benchmark: avoid needless copy_to_user if benchmark fails Date: Wed, 5 Jun 2024 08:01:45 -0400 Message-ID: <20240605120220.2966127-2-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240605120220.2966127-1-sashal@kernel.org> References: <20240605120220.2966127-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.9.3 Content-Transfer-Encoding: 8bit From: Fedor Pchelkin [ Upstream commit f7c9ccaadffd13066353332c13d7e9bf73b8f92d ] If do_map_benchmark() has failed, there is nothing useful to copy back to userspace. Suggested-by: Barry Song <21cnbao@gmail.com> Signed-off-by: Fedor Pchelkin Acked-by: Robin Murphy Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- kernel/dma/map_benchmark.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/dma/map_benchmark.c b/kernel/dma/map_benchmark.c index 02205ab53b7e9..28ca165cb62c1 100644 --- a/kernel/dma/map_benchmark.c +++ b/kernel/dma/map_benchmark.c @@ -252,6 +252,9 @@ static long map_benchmark_ioctl(struct file *file, unsigned int cmd, * dma_mask changed by benchmark */ dma_set_mask(map->dev, old_dma_mask); + + if (ret) + return ret; break; default: return -EINVAL; -- 2.43.0