Skip to content

Commit 52a59bd

Browse files
Alexey Dobriyandavem330
authored andcommitted
net: use 32-bit arithmetic while allocating net device
Private part of allocation is never big enough to warrant size_t. Space savings: add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-10 (-10) function old new delta alloc_netdev_mqs 1120 1110 -10 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 242c1a2 commit 52a59bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/core/dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7989,7 +7989,7 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
79897989
unsigned int txqs, unsigned int rxqs)
79907990
{
79917991
struct net_device *dev;
7992-
size_t alloc_size;
7992+
unsigned int alloc_size;
79937993
struct net_device *p;
79947994

79957995
BUG_ON(strlen(name) >= sizeof(dev->name));

0 commit comments

Comments
 (0)