Re: [PATCH 1/4] alarmtimer: Unregister wakeup source when module get fails

From: Doug Anderson
Date: Tue Jan 14 2020 - 22:41:05 EST


Hi,

On Thu, Jan 9, 2020 at 7:59 AM Stephen Boyd <swboyd@xxxxxxxxxxxx> wrote:
>
> The alarmtimer_rtc_add_device() function creates a wakeup source and
> then tries to grab a module reference. If that fails we return early
> with a -1, but forget to remove the wakeup source. Cleanup this exit
> path so we don't leave a dangling wakeup source allocated and named
> 'alarmtimer' that will conflict with another RTC device that may be
> registered.
>
> Fixes: 51218298a25e ("alarmtimer: Ensure RTC module is not unloaded")
> Signed-off-by: Stephen Boyd <swboyd@xxxxxxxxxxxx>
> ---
> kernel/time/alarmtimer.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)

Reviewed-by: Douglas Anderson <dianders@xxxxxxxxxxxx>