From: Gao Feng Date: Tue, 18 Oct 2016 00:57:50 +0000 (+0800) Subject: net: vlan: Use sizeof instead of literal number X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9c403b6beeeb6cccebb745804820fdccf38125a7;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git net: vlan: Use sizeof instead of literal number Use sizeof variable instead of literal number to enhance the readability. Signed-off-by: Gao Feng Signed-off-by: David S. Miller --- diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index f8903c1e1010..9accde339601 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c @@ -515,8 +515,8 @@ static int vlan_ioctl_handler(struct net *net, void __user *arg) return -EFAULT; /* Null terminate this sucker, just in case. */ - args.device1[23] = 0; - args.u.device2[23] = 0; + args.device1[sizeof(args.device1) - 1] = 0; + args.u.device2[sizeof(args.u.device2) - 1] = 0; rtnl_lock();