Re: [PATCH 3/3] workqueue: add a check point inpwq_activate_delayed_work()
From: Tejun Heo
Date: Wed Jun 05 2013 - 03:18:03 EST
On Wed, Jun 05, 2013 at 03:11:35PM +0800, Michael Wang wrote:
> get_work_pwq() is possible to return NULL, add a check point for that in
> the context inside pwq_activate_delayed_work().
>
> CC: Tejun Heo <tj@xxxxxxxxxx>
> Signed-off-by: Michael Wang <wangyun@xxxxxxxxxxxxxxxxxx>
> ---
> kernel/workqueue.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/kernel/workqueue.c b/kernel/workqueue.c
> index ee8e29a..ea2ec38 100644
> --- a/kernel/workqueue.c
> +++ b/kernel/workqueue.c
> @@ -1072,6 +1072,7 @@ static void put_pwq_unlocked(struct pool_workqueue *pwq)
> static void pwq_activate_delayed_work(struct work_struct *work)
> {
> struct pool_workqueue *pwq = get_work_pwq(work);
> + BUG_ON(!pwq);
pwq deref right below is gonna crash anyway and it's not like that
crash is gonna difficult to identify. How is this an improvement?
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/