netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: lapb: Decrease the refcount of "struct lapb_cb" in lapb_device_event
@ 2020-12-31 17:43 Xie He
  2021-01-04 21:50 ` patchwork-bot+netdevbpf
  2021-01-06  7:35 ` Martin Schiller
  0 siblings, 2 replies; 3+ messages in thread
From: Xie He @ 2020-12-31 17:43 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, linux-x25, netdev, linux-kernel,
	Martin Schiller
  Cc: Xie He

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 <ms@dev.tdt.de>
Signed-off-by: Xie He <xie.he.0141@gmail.com>
---
 net/lapb/lapb_iface.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/lapb/lapb_iface.c b/net/lapb/lapb_iface.c
index 213ea7abc9ab..40961889e9c0 100644
--- a/net/lapb/lapb_iface.c
+++ b/net/lapb/lapb_iface.c
@@ -489,6 +489,7 @@ static int lapb_device_event(struct notifier_block *this, unsigned long event,
 		break;
 	}
 
+	lapb_put(lapb);
 	return NOTIFY_DONE;
 }
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: lapb: Decrease the refcount of "struct lapb_cb" in lapb_device_event
  2020-12-31 17:43 [PATCH net] net: lapb: Decrease the refcount of "struct lapb_cb" in lapb_device_event Xie He
@ 2021-01-04 21:50 ` patchwork-bot+netdevbpf
  2021-01-06  7:35 ` Martin Schiller
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-01-04 21:50 UTC (permalink / raw)
  To: Xie He; +Cc: davem, kuba, linux-x25, netdev, linux-kernel, ms

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Thu, 31 Dec 2020 09:43:31 -0800 you wrote:
> 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 <ms@dev.tdt.de>
> Signed-off-by: Xie He <xie.he.0141@gmail.com>
> 
> [...]

Here is the summary with links:
  - [net] net: lapb: Decrease the refcount of "struct lapb_cb" in lapb_device_event
    https://git.kernel.org/netdev/net/c/b40f97b91a3b

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: lapb: Decrease the refcount of "struct lapb_cb" in lapb_device_event
  2020-12-31 17:43 [PATCH net] net: lapb: Decrease the refcount of "struct lapb_cb" in lapb_device_event Xie He
  2021-01-04 21:50 ` patchwork-bot+netdevbpf
@ 2021-01-06  7:35 ` Martin Schiller
  1 sibling, 0 replies; 3+ messages in thread
From: Martin Schiller @ 2021-01-06  7:35 UTC (permalink / raw)
  To: Xie He; +Cc: David S. Miller, Jakub Kicinski, linux-x25, netdev, linux-kernel

On 2020-12-31 18:43, Xie He wrote:
> 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 <ms@dev.tdt.de>
> Signed-off-by: Xie He <xie.he.0141@gmail.com>
> ---
>  net/lapb/lapb_iface.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/net/lapb/lapb_iface.c b/net/lapb/lapb_iface.c
> index 213ea7abc9ab..40961889e9c0 100644
> --- a/net/lapb/lapb_iface.c
> +++ b/net/lapb/lapb_iface.c
> @@ -489,6 +489,7 @@ static int lapb_device_event(struct notifier_block
> *this, unsigned long event,
>  		break;
>  	}
> 
> +	lapb_put(lapb);
>  	return NOTIFY_DONE;
>  }

Well, I guess I missed that one. Thank you!

Acked-by: Martin Schiller <ms@dev.tdt.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-06  7:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-31 17:43 [PATCH net] net: lapb: Decrease the refcount of "struct lapb_cb" in lapb_device_event Xie He
2021-01-04 21:50 ` patchwork-bot+netdevbpf
2021-01-06  7:35 ` Martin Schiller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).