[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87d1lz5ky1.fsf@gmail.com>
Date: Wed, 27 Jul 2016 14:23:18 +0200
From: Nicolai Stange <nicstange@...il.com>
To: "Gaurav Jindal \(Gaurav Jindal\)" <Gaurav.Jindal@...eadtrum.com>
Cc: "tglx\@linutronix.de" <tglx@...utronix.de>,
"linux-kernel\@vger.kernel.org" <linux-kernel@...r.kernel.org>,
"Sanjeev Yadav \(Sanjeev Kumar Yadav\)"
<Sanjeev.Yadav@...eadtrum.com>
Subject: Re: [PATCH]optimize error handling in tick_check_new_device
"Gaurav Jindal (Gaurav Jindal)" <Gaurav.Jindal@...eadtrum.com> writes:
> diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
> index 4fcd99e..23faf4a 100644
> --- a/kernel/time/tick-common.c
> +++ b/kernel/time/tick-common.c
> @@ -307,6 +307,9 @@ void tick_check_new_device(struct clock_event_device *newdev)
> td = &per_cpu(tick_cpu_device, cpu);
> curdev = td->evtdev;
>
> + if (!try_module_get(newdev->owner))
> + return;
> +
Doesn't this leak a reference to newdev->owner if one of the following
conditions hold?
> /* cpu local device ? */
> if (!tick_check_percpu(curdev, newdev, cpu))
> goto out_bc;
> @@ -315,8 +318,6 @@ void tick_check_new_device(struct clock_event_device *newdev)
> if (!tick_check_preferred(curdev, newdev))
> goto out_bc;
> - if (!try_module_get(newdev->owner))
> - return;
>
Thanks,
Nicolai
Powered by blists - more mailing lists