Skip to content

Commit 1203904

Browse files
shemmingerdavem330
authored andcommitted
tun/tap: use paren's with sizeof
Although sizeof is an operator in C. The kernel coding style convention is to always use it like a function and add parenthesis. Signed-off-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6b0355f commit 1203904

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/net/tap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,7 @@ int tap_queue_resize(struct tap_dev *tap)
12151215
int n = tap->numqueues;
12161216
int ret, i = 0;
12171217

1218-
arrays = kmalloc(sizeof *arrays * n, GFP_KERNEL);
1218+
arrays = kmalloc_array(n, sizeof(*arrays), GFP_KERNEL);
12191219
if (!arrays)
12201220
return -ENOMEM;
12211221

drivers/net/tun.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2737,7 +2737,7 @@ static int tun_queue_resize(struct tun_struct *tun)
27372737
int n = tun->numqueues + tun->numdisabled;
27382738
int ret, i;
27392739

2740-
arrays = kmalloc(sizeof *arrays * n, GFP_KERNEL);
2740+
arrays = kmalloc_array(n, sizeof(*arrays), GFP_KERNEL);
27412741
if (!arrays)
27422742
return -ENOMEM;
27432743

0 commit comments

Comments
 (0)