Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3a5cd9e authored by Adrian Bunk's avatar Adrian Bunk Committed by David S. Miller
Browse files

[NET]: Fix an off-by-21-or-49 error.



This patch fixes an off-by-21-or-49 error ;-) spotted by the Coverity
checker.

Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d938ab44
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ static ssize_t show_operstate(struct class_device *dev, char *buf)
		operstate = IF_OPER_DOWN;
	read_unlock(&dev_base_lock);

	if (operstate >= sizeof(operstates))
	if (operstate >= ARRAY_SIZE(operstates))
		return -EINVAL; /* should not happen */

	return sprintf(buf, "%s\n", operstates[operstate]);