From 76fde07d1c22fdc31285bf47c8755af445264b9f Mon Sep 17 00:00:00 2001 From: zhanghongyu Date: Wed, 1 Mar 2023 16:13:22 +0800 Subject: [PATCH] netdev: remove ASSERT when ifindex is invalid There is no control over whether a valid index is input when user use ioctl to get netdev information, so removing this assertion will allow ENODEV to be returned. Signed-off-by: zhanghongyu --- net/netdev/netdev_findbyindex.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/netdev/netdev_findbyindex.c b/net/netdev/netdev_findbyindex.c index afed76fee2..44a5571cdb 100644 --- a/net/netdev/netdev_findbyindex.c +++ b/net/netdev/netdev_findbyindex.c @@ -61,7 +61,6 @@ FAR struct net_driver_s *netdev_findbyindex(int ifindex) * POSIX to mean no interface index. */ - DEBUGASSERT(ifindex > 0 && ifindex <= MAX_IFINDEX); if (ifindex < 1 || ifindex > MAX_IFINDEX) { return NULL;