Skip to contentSkip to conversation

net: lapb: Decrease the refcount of "struct lapb_cb" in lapb_device_event

PATCH Applied Xie He 3 participants 3 messages Dec 31, 2020 – Jan 6, 2021

Subsystems (3)
lore
Share & tools
lore

Xie He

author
#0 lore raw

PATCH 1/1 net: lapb: Decrease the refcount of "struct lapb_cb" in lapb_device_event

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]>
---
 net/lapb/lapb_iface.c | 1 +
 1 file changed, 1 insertion(+)
net/lapb/lapb_iface.c +1 -0
index 213ea7abc9ab..40961889e9c0 100644
@@ -489,6 +489,7 @@ static int lapb_device_event(struct notifier_block *this, unsigned long event,
 		break;
 	}
 
+	lapb_put(lapb);
 	return NOTIFY_DONE;
 }
 
Signature · 1 line
2.27.0
#1 lore raw
This patch was applied to netdev/net.git (refs/heads/master):

Hello:

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

Quoted 11 lines · 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 <[email protected]>

[...]

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

maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Xie He
Quoted 18 lines · 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 <[email protected]>
---
 net/lapb/lapb_iface.c | 1 +
 1 file changed, 1 insertion(+)
net/lapb/lapb_iface.c +0 -0
index 213ea7abc9ab..40961889e9c0 100644

net/lapb/lapb_iface.c static int lapb_device_event(struct notifier_block · line 495

Quoted 7 lines
net/lapb/lapb_iface.c +1 -0
@@ -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!