]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - include/linux/if_vlan.h
[VLAN]: Reduce memory consumed by vlan_groups
[mv-sheeva.git] / include / linux / if_vlan.h
index 79504b22a932fc81df03f75990097bb27b8e5ad7..edd55af7ebd61841e71cab2af58e5a4c5af0efec 100644 (file)
@@ -93,7 +93,7 @@ static inline struct net_device *vlan_group_get_device(struct vlan_group *vg,
 {
        struct net_device **array;
        array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN];
-       return array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN];
+       return array ? array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] : NULL;
 }
 
 static inline void vlan_group_set_device(struct vlan_group *vg,