]> Git Repo - linux.git/commitdiff
net: lapb: Decrease the refcount of "struct lapb_cb" in lapb_device_event
authorXie He <[email protected]>
Thu, 31 Dec 2020 17:43:31 +0000 (09:43 -0800)
committerJakub Kicinski <[email protected]>
Mon, 4 Jan 2021 21:42:41 +0000 (13:42 -0800)
In lapb_device_event, lapb_devtostruct is called to get a reference to
an object of "struct lapb_cb". lapb_devtostruct increases the refcount
of the object and returns a pointer to it. However, we didn't decrease
the refcount after we finished using the pointer. This patch fixes this
problem.

Fixes: a4989fa91110 ("net/lapb: support netdev events")
Cc: Martin Schiller <[email protected]>
Signed-off-by: Xie He <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
net/lapb/lapb_iface.c

index 213ea7abc9ab25b51b5c028f79f31ed56752f572..40961889e9c01add01792690e61c16a04647cc4c 100644 (file)
@@ -489,6 +489,7 @@ static int lapb_device_event(struct notifier_block *this, unsigned long event,
                break;
        }
 
+       lapb_put(lapb);
        return NOTIFY_DONE;
 }
 
This page took 0.054309 seconds and 4 git commands to generate.