Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3026297ybt; Mon, 29 Jun 2020 13:15:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBSkh004I5nYUTFNj/0yfFCvjZXRJwTcDj041cHjAb+jUr3l9hr3EyhxagSCy1XSTapmT6 X-Received: by 2002:a17:906:7ad7:: with SMTP id k23mr16018995ejo.439.1593461710037; Mon, 29 Jun 2020 13:15:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593461710; cv=none; d=google.com; s=arc-20160816; b=Sh2pwdrNBCNEQ7+Se84PuZiPPEdbi/bQKm6CC05viqedOyhkWyHUUftx8Rvvp2s6Ey MrpGtCudvoc4GkDWq8DnQyo2IV5DR5Ejxa9bF1wFVbxPO8QOkYeFuEs+iq3CyxioAZqf k711l7Sm81NawZuq0ybEY320DEelT4x2yFl/FvKPvG16rurcrzxKQ+UbjEQcgDZBwfGg 91r2lAW9rTDaD7HM6QcFLyz1Dz9CPgGcEeRjs4wunov8uwbaerbGYb4DWu1skuTlNHPu AwU94lsmcv6E6frGL817UPDLHAyfP53p67ETPTWTEThaVPka6HVlt7wjOfhu4964DEqw TD2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bK4rREgFbCH8LYle7Zi78doweL/s+U+t/w4sUwpfYKI=; b=m4UrOMQIsG3vU3c4/YfvgfvCUn0tgtqctG/FwJpyItYtNOHGH/qBpc8yfzbuRm/Qrs KclxqG+ftnXzlDvQZhYC8db7N0CVDprDHc0YWGqe3Hge0VVkLxo/Cny2ZgTi4r1Yoppd nc6MUdHyEX04vFZ2uenHKSy8VLqoWymmRZ2q6xzzbsn5rZmogH7vhyUHbkaF+H2JWFSq ZpK6ZZjuALgwJ0PMtnhQs5ACE15gybu5VbAR0BzCqaF3ZSK2nyaQWw6fGTE5dCPPFclz cadPyV+9HJsAPKQ0zGzTqDGkwhpVlnwkw9RaxNPlEItp4UIuNnY3N4vCv/0kenh0jxpy Qrtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TYIrEJqP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zp8si402211ejb.255.2020.06.29.13.14.46; Mon, 29 Jun 2020 13:15:10 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=TYIrEJqP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730547AbgF2UMY (ORCPT + 99 others); Mon, 29 Jun 2020 16:12:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:40574 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732885AbgF2TaU (ORCPT ); Mon, 29 Jun 2020 15:30:20 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DACF525283; Mon, 29 Jun 2020 15:36:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593444994; bh=+fjJTwtTffvmuCdEVZGk9qwlYddz6jrFPC0zOsFVzGY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TYIrEJqPk8PmGUUFzyucKdWrLJpiAB4GXEK7Sa9ZoRrfsR1x4350TbQYM/JdE8YJK Dtl45iEeeaXJ3aciSSBBQ10X90EYbOClxwDT4Z6S3jnrfqJ0xGG67tsm3pMnwFE9wa v+5zkh060UJcV94HtsD2yH0m3sptxqEhZpAg8i+A= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dinghao Liu , Alexander Sverdlin , Herbert Xu , Sasha Levin Subject: [PATCH 4.19 094/131] hwrng: ks-sa - Fix runtime PM imbalance on error Date: Mon, 29 Jun 2020 11:34:25 -0400 Message-Id: <20200629153502.2494656-95-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200629153502.2494656-1-sashal@kernel.org> References: <20200629153502.2494656-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.131-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.19.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.19.131-rc1 X-KernelTest-Deadline: 2020-07-01T15:34+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dinghao Liu [ Upstream commit 95459261c99f1621d90bc628c2a48e60b7cf9a88 ] pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Reviewed-by: Alexander Sverdlin Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/char/hw_random/ks-sa-rng.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/char/hw_random/ks-sa-rng.c b/drivers/char/hw_random/ks-sa-rng.c index 62c6696c1dbd8..b6d7db362b217 100644 --- a/drivers/char/hw_random/ks-sa-rng.c +++ b/drivers/char/hw_random/ks-sa-rng.c @@ -216,6 +216,7 @@ static int ks_sa_rng_probe(struct platform_device *pdev) ret = pm_runtime_get_sync(dev); if (ret < 0) { dev_err(dev, "Failed to enable SA power-domain\n"); + pm_runtime_put_noidle(dev); pm_runtime_disable(dev); return ret; } -- 2.25.1