Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp192251pxf; Thu, 8 Apr 2021 00:20:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxce3GSPrkJAZrwEOaEPMVQGcwowj+XCaZ2c6sqNukKlPXtOViril5ffX4UOFRfymd7Kh0u X-Received: by 2002:a17:90a:73c2:: with SMTP id n2mr6965883pjk.170.1617866450606; Thu, 08 Apr 2021 00:20:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617866450; cv=none; d=google.com; s=arc-20160816; b=k1BWgaQEfYvvWyVZRhMKoXV5od0eAWfQ24mjqMYiXEP70tL6umYQQs/ns2QLE8Wgft kxZk+9oBFF2it2yboTpXOm3mqcBjSEq+bU8obNrAQr0gdyXNOJURCwprgv2l/CQrgC6b nYpLOp0wbNVpwRMGRuV2M/2VN4g6lA3HhjIrvzHHxbx1mAC8YJWKs+331RzKH/VS4MGR rsYolk6S8r0r+UZHv0mvrJjstksgwrCOGnti7KFUQBr/0cGY4s99bMeafzd3DwlMk5pQ 2ZAjfdBbms6oqI7/GrJEFhtk+acX4Zdat8jIsHpM9yiWQGXrcrbVVRt6BC+xKerCvHo3 b6hQ== 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=iR7eHxqvtWtH6kLpC6dhKNDCusq9XbF+hfLUrHYonok=; b=tSbR5iN08oYoL3NncVmLPl447IsR/b21TuIcCyqXa/XBwOE+c/lPNgmqBRInM6kH8A xddB4CAnQ9pJwc38zxSlTr2qDajzB0apQyzTzIyoV5Ec5jEf5qJTKkQLhkdCwsJS83An 0H43i4dquocC1QlSj4ZUkOMXHTTBcNw7M/oos04cjT9ZV5SJOQLUa2WQfPtc/42/pRH7 xuxuHWrrPqtsbxr5jpn+2MvwCuughYFR1FXY8bWXCz+wA/2wwTf7W80MDInMYZYJRejN 5sECj1N400CphH/jh2U/pmxcjkTM9ZJtjxI1abblWVm6h++qDTQcQb7rHV9u+um2BhCl wn9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x10si5818423pll.273.2021.04.08.00.20.38; Thu, 08 Apr 2021 00:20:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229623AbhDHHTb (ORCPT + 99 others); Thu, 8 Apr 2021 03:19:31 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:16827 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230199AbhDHHTa (ORCPT ); Thu, 8 Apr 2021 03:19:30 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FGCJ24WBVz93XR; Thu, 8 Apr 2021 15:17:06 +0800 (CST) Received: from huawei.com (10.175.113.32) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.498.0; Thu, 8 Apr 2021 15:19:10 +0800 From: Shixin Liu To: Herbert Xu , "David S. Miller" CC: , , Shixin Liu Subject: [PATCH -next 6/7] crypto: sa2ul - Fix PM reference leak in sa_ul_probe() Date: Thu, 8 Apr 2021 15:18:37 +0800 Message-ID: <20210408071837.836892-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.32] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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. Fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced. Signed-off-by: Shixin Liu --- drivers/crypto/sa2ul.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/sa2ul.c b/drivers/crypto/sa2ul.c index f300b0a5958a..d7b1628fb484 100644 --- a/drivers/crypto/sa2ul.c +++ b/drivers/crypto/sa2ul.c @@ -2350,7 +2350,7 @@ static int sa_ul_probe(struct platform_device *pdev) dev_set_drvdata(sa_k3_dev, dev_data); pm_runtime_enable(dev); - ret = pm_runtime_get_sync(dev); + ret = pm_runtime_resume_and_get(dev); if (ret < 0) { dev_err(&pdev->dev, "%s: failed to get sync: %d\n", __func__, ret); -- 2.25.1