This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 292276101bd net/vlan: make a judgment before calling fuction
292276101bd is described below

commit 292276101bd99699e5ef4795b9298a9d79600b0a
Author: gaohedong <[email protected]>
AuthorDate: Mon Apr 14 21:36:34 2025 +0800

    net/vlan: make a judgment before calling fuction
    
    Make a judgment before calling fuction.
    
    Signed-off-by: gaohedong <[email protected]>
---
 drivers/net/vlan.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/vlan.c b/drivers/net/vlan.c
index 78259d52192..4cd0d8e9f71 100644
--- a/drivers/net/vlan.c
+++ b/drivers/net/vlan.c
@@ -250,7 +250,10 @@ static void vlan_reclaim(FAR struct netdev_lowerhalf_s 
*dev)
   FAR struct vlan_device_s      *vlan = (FAR struct vlan_device_s *)dev;
   FAR struct netdev_lowerhalf_s *real = vlan->real;
 
-  real->ops->reclaim(real);
+  if (real->ops->reclaim != NULL)
+    {
+      real->ops->reclaim(real);
+    }
 }
 
 /****************************************************************************

Reply via email to