All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] can: avoid unnecessary remove in can_remove_proc
@ 2019-12-30  9:03 ` YueHaibing
  0 siblings, 0 replies; 2+ messages in thread
From: YueHaibing @ 2019-12-30  9:03 UTC (permalink / raw)
  To: socketcan, mkl, davem; +Cc: linux-can, netdev, linux-kernel, YueHaibing

If net->can.proc_dir is null, there is no need to
do cleanup in can_remove_proc.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 net/can/proc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/can/proc.c b/net/can/proc.c
index e6881bf..f84e977 100644
--- a/net/can/proc.c
+++ b/net/can/proc.c
@@ -471,6 +471,9 @@ void can_init_proc(struct net *net)
  */
 void can_remove_proc(struct net *net)
 {
+	if (!net->can.proc_dir)
+		return;
+
 	if (net->can.pde_version)
 		remove_proc_entry(CAN_PROC_VERSION, net->can.proc_dir);
 
-- 
2.7.4

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

* [PATCH net-next] can: avoid unnecessary remove in can_remove_proc
@ 2019-12-30  9:03 ` YueHaibing
  0 siblings, 0 replies; 2+ messages in thread
From: YueHaibing @ 2019-12-30  9:03 UTC (permalink / raw)
  To: socketcan, mkl, davem; +Cc: linux-can, netdev, linux-kernel, YueHaibing

If net->can.proc_dir is null, there is no need to
do cleanup in can_remove_proc.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 net/can/proc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/can/proc.c b/net/can/proc.c
index e6881bf..f84e977 100644
--- a/net/can/proc.c
+++ b/net/can/proc.c
@@ -471,6 +471,9 @@ void can_init_proc(struct net *net)
  */
 void can_remove_proc(struct net *net)
 {
+	if (!net->can.proc_dir)
+		return;
+
 	if (net->can.pde_version)
 		remove_proc_entry(CAN_PROC_VERSION, net->can.proc_dir);
 
-- 
2.7.4



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

end of thread, other threads:[~2019-12-30  9:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-30  9:03 [PATCH net-next] can: avoid unnecessary remove in can_remove_proc YueHaibing
2019-12-30  9:03 ` YueHaibing

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.