Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp718647pxu; Mon, 23 Nov 2020 02:18:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6EBSadPyQcPesXO7LagsvhZx4qHyiX43PFdh7FlTK50PTAbb+OKVAd1/bG2GN7jIwLQvu X-Received: by 2002:a05:6402:553:: with SMTP id i19mr45226175edx.194.1606126680940; Mon, 23 Nov 2020 02:18:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606126680; cv=none; d=google.com; s=arc-20160816; b=mO+e9TjCBYOrrLV8fwfcfvzCvfKeELIGRy4+Wv6ik4pzcQrU5DkmrIu8/LHdVTUSza ZLBKPP89cuA+FhOuRGegLMkkZZ6qUoET0RG6yxolmatgRxjf4xqMVKC0GcuI8nRkViq9 p59nuUrsW2rwXy7Pv1u6YmIfr6Y4drxgsv2Q/UXYoTUF0YspKyjjW8eLiQbuCWcUjLrS 2mwmadXE2+WN7H0aNYUmGzHaRNvaWHdcN7AM9ZWUDqGJyiTd11+1EPlWztWDeoPDMGy4 bg1Z+cYxnYBZ7ufJeWqGGvHLYmcNOHM/hTosPAhyOeOWoeI1IefhQjrqE99IVSxrbxOy O4gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=3HpJQZ/l7TeSKCX5C7J5qw5Tdr6cFuXABVn3KR+/PRs=; b=H8g/pDATw9tlTeKPGU6HIYGSrFzcuAGxp7g9MVHF1otkBAtTnnIUHK/2ukvOe5d1Lw M/s1+3h+7112eQivD63Mgv+mc3j2EM4Jg3q1sk/jULVEdU3gzbO0glxgbPK5ahYEmvET tDn1/d48PmOwAMfqoQBtBQjRmxqzHkXvSBP6W7FBqqrAgl5uuN0Teg7n9H5PezdwPWf/ 8qP1D3d177qFgqlzI88pVXnHA7fft8wo/DUkzDnjR7NizFaNqtbyqJS9WJZ5OD/M5780 SneEo83cthHPDCCMT1NjLSPqqUWiIjr10KQ/lN1IZNt3ISko0Svpt5nxhsaPd8ZJkdo3 wWiQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b27si6276844eje.466.2020.11.23.02.17.38; Mon, 23 Nov 2020 02:18:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727874AbgKWKPB (ORCPT + 99 others); Mon, 23 Nov 2020 05:15:01 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:7666 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725843AbgKWKPB (ORCPT ); Mon, 23 Nov 2020 05:15:01 -0500 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Cfjgh1Xn2z15RBb; Mon, 23 Nov 2020 18:14:40 +0800 (CST) Received: from huawei.com (10.175.127.227) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Mon, 23 Nov 2020 18:14:56 +0800 From: Zhang Qilong To: CC: , , Subject: [PATCH] HSI: Fix PM usage counter unbalance in ssi_hw_init Date: Mon, 23 Nov 2020 18:18:27 +0800 Message-ID: <20201123101827.3863792-1-zhangqilong3@huawei.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. We fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced. Fixes: b209e047bc743 ("HSI: Introduce OMAP SSI driver") Signed-off-by: Zhang Qilong --- drivers/hsi/controllers/omap_ssi_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hsi/controllers/omap_ssi_core.c b/drivers/hsi/controllers/omap_ssi_core.c index fa69b94debd9..b4ac2f8cb9f9 100644 --- a/drivers/hsi/controllers/omap_ssi_core.c +++ b/drivers/hsi/controllers/omap_ssi_core.c @@ -424,7 +424,7 @@ static int ssi_hw_init(struct hsi_controller *ssi) struct omap_ssi_controller *omap_ssi = hsi_controller_drvdata(ssi); int err; - err = pm_runtime_get_sync(ssi->device.parent); + err = pm_runtime_resume_and_get(ssi->device.parent); if (err < 0) { dev_err(&ssi->device, "runtime PM failed %d\n", err); return err; -- 2.25.4