If net->can.proc_dir is null, there is no need to do cleanup in can_remove_proc. Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx> --- 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