Re: [PATCH] netlink: put module reference if dump start fails

From: David Miller
Date: Thu Feb 22 2018 - 14:04:45 EST


From: "Jason A. Donenfeld" <Jason@xxxxxxxxx>
Date: Wed, 21 Feb 2018 04:41:59 +0100

> Before, if cb->start() failed, the module reference would never be put,
> because cb->cb_running is intentionally false at this point. Users are
> generally annoyed by this because they can no longer unload modules that
> leak references. Also, it may be possible to tediously wrap a reference
> counter back to zero, especially since module.c still uses atomic_inc
> instead of refcount_inc.
>
> This patch expands the error path to simply call module_put if
> cb->start() fails.
>
> Signed-off-by: Jason A. Donenfeld <Jason@xxxxxxxxx>
> ---
> This probably should be queued up for stable.

Applied and queued up for -stable.