• Ziyang Xuan's avatar
    net: hso: add failure handler for add_net_device · ecdc28de
    Ziyang Xuan authored
    If the network devices connected to the system beyond
    HSO_MAX_NET_DEVICES. add_net_device() in hso_create_net_device()
    will be failed for the network_table is full. It will lead to
    business failure which rely on network_table, for example,
    hso_suspend() and hso_resume(). It will also lead to memory leak
    because resource release process can not search the hso_device
    object from network_table in hso_free_interface().
    
    Add failure handler for add_net_device() in hso_create_net_device()
    to solve the above problems.
    
    Fixes: 72dc1c09 ("HSO: add option hso driver")
    Signed-off-by: default avatarZiyang Xuan <william.xuanziyang@huawei.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    ecdc28de
hso.c 83.3 KB