Skip to content

Commit

Permalink
net: lapb: Decrease the refcount of "struct lapb_cb" in lapb_device_e…
Browse files Browse the repository at this point in the history
…vent

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: a4989fa ("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]>
  • Loading branch information
Xie He authored and kuba-moo committed Jan 4, 2021
1 parent e80bd76 commit b40f97b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/lapb/lapb_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ static int lapb_device_event(struct notifier_block *this, unsigned long event,
break;
}

lapb_put(lapb);
return NOTIFY_DONE;
}

Expand Down

0 comments on commit b40f97b

Please sign in to comment.