Re: [PATCH v2] packet: Fix error path in packet_init

From: David Miller
Date: Thu May 09 2019 - 16:48:04 EST


From: YueHaibing <yuehaibing@xxxxxxxxxx>
Date: Thu, 9 May 2019 22:52:20 +0800

> kernel BUG at lib/list_debug.c:47!
...
> When modprobe af_packet, register_pernet_subsys
> fails and does a cleanup, ops->list is set to LIST_POISON1,
> but the module init is considered to success, then while rmmod it,
> BUG() is triggered in __list_del_entry_valid which is called from
> unregister_pernet_subsys. This patch fix error handing path in
> packet_init to avoid possilbe issue if some error occur.
>
> Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
> Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx>
> ---
> v2: rework commit log

Applied and queued up for -stable, thank you.