OSDN Git Service

soc: qcom: glink_ssr: Initialize waitqueue in probe function
authorDhoat Harpal <hdhoat@codeaurora.org>
Mon, 12 Mar 2018 11:42:13 +0000 (17:12 +0530)
committerGerrit - the friendly Code Review server <code-review@localhost>
Tue, 8 May 2018 06:35:18 +0000 (23:35 -0700)
waitqueue is initialized on every call to notify_for_subsystem.
This leads to stability issue if one thread is waiting for completion
and another thread re-initializes it.

Waitqueue is initialized only in probe function.

CRs-Fixed: 2197181
Change-Id: I3509a7c4a197c727b2025c1aeb6a35690c3c8501
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
drivers/soc/qcom/glink_ssr.c

index fe7fb1e..177737f 100644 (file)
@@ -538,7 +538,6 @@ int notify_for_subsystem(struct subsys_info *ss_info)
         * only modified during setup.
         */
        atomic_set(&responses_remaining, ss_info->notify_list_len);
-       init_waitqueue_head(&waitqueue);
        notifications_successful = true;
 
        list_for_each_entry(ss_leaf_entry, &ss_info->notify_list,
@@ -945,7 +944,7 @@ static int glink_ssr_probe(struct platform_device *pdev)
        ss_info->cb_data = NULL;
        spin_lock_init(&ss_info->link_up_lock);
        spin_lock_init(&ss_info->cb_lock);
-
+       init_waitqueue_head(&waitqueue);
        nb = kmalloc(sizeof(struct restart_notifier_block), GFP_KERNEL);
        if (!nb) {
                GLINK_SSR_ERR("<SSR> %s: Could not allocate notifier block\n",