Thread (30 messages) 30 messages, 10 authors, 2022-09-23

Re: [PATCH 07/12] igb: Proactively round up to kmalloc bucket size

From: Kees Cook <hidden>
Date: 2022-09-22 16:00:35
Also in: dri-devel, intel-wired-lan, linux-btrfs, linux-fsdevel, linux-hardening, linux-media, linux-mm, linux-wireless, lkml, llvm

On Thu, Sep 22, 2022 at 03:56:54PM +0000, Ruhl, Michael J wrote:
quoted
From: dri-devel <redacted> On Behalf Of Kees Cook
[...]
quoted
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c
b/drivers/net/ethernet/intel/igb/igb_main.c
index 2796e81d2726..4d70ee5b0f79 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -1196,6 +1196,7 @@ static int igb_alloc_q_vector(struct igb_adapter
*adapter,

	ring_count = txr_count + rxr_count;
	size = struct_size(q_vector, ring, ring_count);
+	size = kmalloc_size_roundup(size);
why not:

	size = kmalloc_size_roundup(struct_size(q_vector, ring, ring_count));

?
Sure! I though it might be more readable split up. I will change it. :)

-- 
Kees Cook
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help