]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/llc/llc_core.c
llc: use refcount_inc_not_zero() for llc_sap_find()
[mirror_ubuntu-bionic-kernel.git] / net / llc / llc_core.c
index 89041260784c0871195556074f7138eee01edb33..260b3dc1b4a2ab4545982b0b36478d6a6cf0b71f 100644 (file)
@@ -73,8 +73,8 @@ struct llc_sap *llc_sap_find(unsigned char sap_value)
 
        rcu_read_lock_bh();
        sap = __llc_sap_find(sap_value);
-       if (sap)
-               llc_sap_hold(sap);
+       if (!sap || !llc_sap_hold_safe(sap))
+               sap = NULL;
        rcu_read_unlock_bh();
        return sap;
 }