Skip to contentSkip to conversation

iov_iter: use "maxpages" parameter

PATCH Applied Dan Carpenter 2 participants 2 messages Sep 8, 2022 – Sep 16, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iov_iter: use "maxpages" parameter

This was intended to be "maxpages" instead of INT_MAX. There is only one caller and it passes INT_MAX so this does not affect runtime.

Fixes b93235e68921 ("tls: cap the output scatter list to something reasonable")

---
I'm not sure which tree this should go through. It's a cleanup and the only caller is in networking so probably net-next is easiest.

 include/linux/uio.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/uio.h +1 -1
index e26908e443d1..47aec904a3eb 100644
@@ -302,7 +302,7 @@ iov_iter_npages_cap(struct iov_iter *i, int maxpages, size_t max_bytes)
 		shorted = iov_iter_count(i) - max_bytes;
 		iov_iter_truncate(i, max_bytes);
 	}
-	npages = iov_iter_npages(i, INT_MAX);
+	npages = iov_iter_npages(i, maxpages);
 	if (shorted)
 		iov_iter_reexpand(i, iov_iter_count(i) + shorted);
 
Signature · 1 line
2.35.1
#1 lore raw
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:

Quoted 10 lines · On Thu, 8 Sep 2022 15:20:23 +0300 you wrote:

This was intended to be "maxpages" instead of INT_MAX. There is only one caller and it passes INT_MAX so this does not affect runtime.

Fixes b93235e68921 ("tls: cap the output scatter list to something reasonable")

---
I'm not sure which tree this should go through. It's a cleanup and the only caller is in networking so probably net-next is easiest.

[...]

Here is the summary with links:
- [net-next] iov_iter: use "maxpages" parameter

    https://git.kernel.org/netdev/net-next/c/7187440dd7c4

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html