Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp262646lqr; Wed, 5 Jun 2024 05:35:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUWb5HT8h9PolKsEXzCKNHYV1HlepMS+fpj2nMGRF2YYcwkyV22y7pNVg8VC3MjRegvT6A1q+fi49fEOK7dle49Uay6lhA4cvQwwwD4cg== X-Google-Smtp-Source: AGHT+IHSVC7TOHx36A+ZJW4MHSrdWmDeg27fzEtOO0dA1WbHD01K6tcjpKerqonxWQh84Bds46QG X-Received: by 2002:a17:906:d969:b0:a65:19da:cdc6 with SMTP id a640c23a62f3a-a699fcdf879mr148469666b.35.1717590905886; Wed, 05 Jun 2024 05:35:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717590905; cv=pass; d=google.com; s=arc-20160816; b=wqFpctOf6gZk57MAJya4NN20sNWlBrPns+aiBb6QgntzgDu5z/W3OuNuI41e+dMsTM ZHGsJW9eSOSe8hRwsOoA6D9L3oAx+I+IRXfo/OOwAiYBYqgEyk9UhqXU66wOKIBD8e8u mcsyYI2/Tj+cEvnWDIgcHwTZu0cA5TheDK9if1eUKWmnEfSEuE6nMr5DraXA4459B+Te wxoQjDFq2I68o3DIsyWgcU3vH0i0P/6Y0ZF9RGL6/MCJjCBz1GJdK4VhoGVS7XnP4GB4 6APdwiAcE3i5MbXutNReBxR555EitNgxEHe38S9KWi3qzJVbShwFcCGK3lcjx38Ds/Jd hTyA== 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=AZ4EE5lmDwuVax/uqwVkahcKxTSpKAA2fs2lGk1s9hlNV3J299wLlXDR39iCHGm6c6 8Xjbj+IZ8z4+2Si8Ma/L5Ng7M8FDe8WbYGQyDwMcNvNjRPp/RGhM6Fhkv47AZeWTzk7d TBPwkDVS6V7sXTmbk2gseZwS9MVvDxB91YB63MmUGb8MDcxQMPyccP1efEeB+CTgvEwK UcvYCXiIl02epnMm1UpEtHFsRbat0dCAqmQDMz6ZIiRlROHh1i6YInQ4uAcgCzw/gh/b GdXdUCyfccENv1xUn7NohBYUPd47UDU9Dbmm1xR62u6qikZKXJPo9gcxRFRv0RhDQElw Gxig==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="d/xdRNHa"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202477-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202477-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. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a690cb44556si295534366b.571.2024.06.05.05.35.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 05:35:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202477-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="d/xdRNHa"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202477-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202477-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 969821F21C04 for ; Wed, 5 Jun 2024 12:35:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A55531993A1; Wed, 5 Jun 2024 12:03:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="d/xdRNHa" 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 C567F1C2252; Wed, 5 Jun 2024 12:03:23 +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=1717589003; cv=none; b=O63HGR6N55Ak6+LV1NrFOTqxikcP7WnzBQ+UMTa3BqPNyI8XiDNwI9XFbg+lNtH09IyBIAsaV+iIsr7Bi8cEiU0G0HAgd7TZj2A8dcEcXA25ydkSny+1tLhzMnOrcv05ixbkFyA128n/v2Wn6sgL9c2v2fe5WuoLms2Or7dUHr8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717589003; c=relaxed/simple; bh=HyWxOHBFsxYxuhl2IOENDQJf/JYMZt5KUEf88qktYTs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B4D9/bhnt3iMJKNDuNIFMLMGfgMjs2Qh2odRHimI9xbvRawhdmwGiFvezaXVzXF6swwh7+nTC/4DINoP12c0LIeXzyJScKOixCZPc/WRJEhLnvwdQH1F7YkYUslk9Hc7GKNGqhyx5yZSEC1I9BxtYn16DLBQnWJ2W7NsRkySMoM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=d/xdRNHa; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F838C32786; Wed, 5 Jun 2024 12:03:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717589003; bh=HyWxOHBFsxYxuhl2IOENDQJf/JYMZt5KUEf88qktYTs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d/xdRNHaajEvJxU+vkVqmdw341dHC2nnhruq6ugC5b9fxmAtxmWS+a8uiBrQgWLIw 2Oee/3xKTGOFURR61AujBvyFG9Ps+rT0tV2icXet7+PAIbWHaWxxQ6myEQuiP9kL2k MiA3HOhV3aZhvLlxEisM6nVWww5Ee1YX1Ag8uwjpjYKZneQfjQH9GGoCb+S6EsWrn3 I6Eagep4qKpjA1+QHXL9ir7pfpV10Okf2MUWTfAmPlm4OQQczWhmBQxdjBpOOusHxI mZngpzU0R+TXDOJ9X+ujeAilTvNMA0z3Ga3ypmEgYa76RyS3F9c1T4u44z4JHyJS5d QNu93ss9Gm/nw== 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.8 02/18] dma-mapping: benchmark: avoid needless copy_to_user if benchmark fails Date: Wed, 5 Jun 2024 08:02:52 -0400 Message-ID: <20240605120319.2966627-2-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240605120319.2966627-1-sashal@kernel.org> References: <20240605120319.2966627-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.8.12 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