Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5458948pxu; Tue, 22 Dec 2020 18:42:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJyU2EN425krtBALs8hcNh/aBQzUDzHQBv23PnvCK5HNQXpNlw4qzgPtUTQZTRubq1CHMmHQ X-Received: by 2002:a50:8387:: with SMTP id 7mr22133985edi.131.1608691348458; Tue, 22 Dec 2020 18:42:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608691348; cv=none; d=google.com; s=arc-20160816; b=vUPqoALwnQ7QteVcRwHkV+db7TmOoBVs62nQUWwLuZFzVvhNUtl6F/mlad4A7Ew43M wEiB0eAWYtILt+HwXstEp6VIhqsGfheJB7JmZPvT8+d3OTjDLouyvLxrmT+a+ZUvA6fu H5xASaeDxwbkxLJsPRIRu+GeUUYzpQuz2uf4kH3rMVIGFyigEjyAmATynXIU9/GUzXS5 D5JxaDWmA5Gj9ahVRefxsWW+NFRZC275cbgkJJVOr2tpkkfeXn3cCY1Wc4VzKgG0Xd0z /QExFaIzmLU9i0/EU43oRkopwQqDRzgz5wdCmwvzROK4qN5+vGlmb+nY6HIDJerSA7X3 A9Tw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=J2y84AlUY7dqvwN8gP7iZXJPzbSKttyEbCVYjpWLMOw=; b=jOSNJfk+gWks4YyK1V2O39oCuRvqysdki6POimaBuTkAKPwITy5GmR6fPIvvz2dIxj v8Zpx3xNSRovTl1K2v9P/IKOSonbxLKLSrQLwceawimK2RIy08efTtgDQ4j2HaDgzIwz siqm21icdIZnaKStEaVuvhBCc3aAzbeSojJeMZovWr/GqLguvXEdyvFx+6FEvSZJ4ijT CZQ/eUSfyBWN2ivMi2oDsULLQsJEfPqnO7STpZiDtg4e6LJl1Np59Ml7UHP9HkPCnrJ0 of5uVS2KutCjIv75gS0usgHoycu8e+mrosPY6w2NsBi1JM9siemV/dCYN2r0b4fG7X+z vlug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=l4Yy0w2y; 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 k6si11395125ejs.633.2020.12.22.18.42.06; Tue, 22 Dec 2020 18:42:28 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=l4Yy0w2y; 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 S1731118AbgLWCmC (ORCPT + 99 others); Tue, 22 Dec 2020 21:42:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:51014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729947AbgLWCXS (ORCPT ); Tue, 22 Dec 2020 21:23:18 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8383922D73; Wed, 23 Dec 2020 02:22:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608690177; bh=UXKOGuw0XHr/W4/vCaNtZZD+Iilf1QiSCxs8krdK5io=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l4Yy0w2yPEdg9HgcIydJfWKvA02k2TmLlIisPahRKx3h+9JeWuLD507w/YuGdaGtN Tw7cBtHbHyv+YfGHykZEPTTFgny6aDQxMJ3fiu+Dc9moxd1Xlz87rqF9ELzgbU5BMT oW6JAdtV845Vp/dL1c65M83nV+rcxrlcXDwOfngP5YSmufKIu2cqNqZgAZnLtpxOdb uR3+vumLnup5wljRKQ5N9DG4jCscqnCcA37TMMz74j+ydvIb/BYF1k6YRdN+S8Ln1x BD8TWjqkHJFQYWteu4FIwFXi5k+s23fw4HzBaae7zUe/fvD/c+H20TPI49jL74O3wH i56EAzt1CXZFQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Zhang Qilong , Herbert Xu , Sasha Levin , linux-crypto@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 03/66] crypto: omap-aes - fix the reference count leak of omap device Date: Tue, 22 Dec 2020 21:21:49 -0500 Message-Id: <20201223022253.2793452-3-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201223022253.2793452-1-sashal@kernel.org> References: <20201223022253.2793452-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhang Qilong [ Upstream commit 383e8a823014532ffd81c787ef9009f1c2bd3b79 ] pm_runtime_get_sync() will increment pm usage counter even when it returns an error code. We should call put operation in error handling paths of omap_aes_hw_init. Signed-off-by: Zhang Qilong Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/omap-aes.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c index c376a3ee7c2c3..57d4269d17f65 100644 --- a/drivers/crypto/omap-aes.c +++ b/drivers/crypto/omap-aes.c @@ -106,6 +106,7 @@ static int omap_aes_hw_init(struct omap_aes_dev *dd) err = pm_runtime_get_sync(dd->dev); if (err < 0) { + pm_runtime_put_noidle(dd->dev); dev_err(dd->dev, "failed to get sync: %d\n", err); return err; } -- 2.27.0