]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
can: proc: can_remove_proc(): silence remove_proc_entry warning
authorZhang Changzhong <zhangchangzhong@huawei.com>
Tue, 14 Jul 2020 06:44:50 +0000 (14:44 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 22 Nov 2020 09:02:26 +0000 (10:02 +0100)
commit567401f58e5e47f5ed41bef03a9541283054e463
tree016f2dc5e8671718fe3558a4efa00b41f6f94881
parent3661391c463edaf588fe94bcca14cb114b37a96e
can: proc: can_remove_proc(): silence remove_proc_entry warning

commit 3accbfdc36130282f5ae9e6eecfdf820169fedce upstream.

If can_init_proc() fail to create /proc/net/can directory, can_remove_proc()
will trigger a warning:

WARNING: CPU: 6 PID: 7133 at fs/proc/generic.c:672 remove_proc_entry+0x17b0
Kernel panic - not syncing: panic_on_warn set ...

Fix to return early from can_remove_proc() if can proc_dir does not exists.

Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Link: https://lore.kernel.org/r/1594709090-3203-1-git-send-email-zhangchangzhong@huawei.com
Fixes: 8e8cda6d737d ("can: initial support for network namespaces")
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/can/proc.c