Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp182756pxx; Wed, 28 Oct 2020 01:57:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiNuCw/Iue6Pa6XNfom23eq0vLqOV9VhaAp8VJzoLHSErVHWNK+J9dfdCLaB5TuWgufeQj X-Received: by 2002:a50:f307:: with SMTP id p7mr6514561edm.235.1603875453505; Wed, 28 Oct 2020 01:57:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603875453; cv=none; d=google.com; s=arc-20160816; b=tWVN1ymq60VKtRCCcekhSMbiA139M3fEDXzwyLOPjiIa3ARLV3bZkYr3pzhF8zVxgR IJ1cxUQEi7vhAC4jeoCJAHomEm/YbdG6v+jp1WFsj3f55Z3PplPPDrc9b/UvcFIaOp25 UiYJx0oosDsNbN7/KKdl3YBIsf9JRxVK0qA0CGqOJZ+MgeifVEKbZojT+yYtrzi50dHb l7tXxa2GXTZfFQTRoK8gyF2oyCXwVMt1VPclQNVv6n6fLiyCrvc5i0uuMZsShASqhvmN BlORv6xLNVT+sLdh9R4/d8LGqlgw2aHBLnrOWUW/hom7veLy/9w9GSkGZUutpm4sBRlT zbeQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KAyqmGk7p3ZG8JYC46nDK7fnMqCAHcLErfcDUf8EKcY=; b=N1B8EpZf+LBytZDvyMWtX7oKiUByc/CGkqabg4Z66EiYLtWmPK602q+Hv5DdwZ7ZZT 9RTEs9juF2ujbz4onGLJv6kjeMUlTEAkSLxkk5fUdRr8YtN9A5013TjpMKBSVc0bvn+p IkGTbBpFqb6VUZkLuM1ujPtF7JfBwaKu0DxyurrfVFu5Gc7kIDhg1xMdUUAsdyTaHhek nr/CWbbmbJYSXD5n2tYWKVtc3cW1twVRkN4Y/L+P5HsfZIrydL2HWqgX5jhFNDR+a7qc Ne1cKVFkWIr9AThQj2LjtJ0or/y2XkjextIMztRpnMoBkgz6N/2aNuvY6HrsKVsD0KbV laQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="t7/n+zpU"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p19si2741759edu.169.2020.10.28.01.57.11; Wed, 28 Oct 2020 01:57:33 -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="t7/n+zpU"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756624AbgJ0OOg (ORCPT + 99 others); Tue, 27 Oct 2020 10:14:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:55020 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754696AbgJ0OGe (ORCPT ); Tue, 27 Oct 2020 10:06:34 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 22D1122284; Tue, 27 Oct 2020 14:06:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807593; bh=ixusXLZ0622zxJIC0QBU4XnVhfywpHExuB4ujs6RIvU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t7/n+zpUdID1vgz7IpDiQwTxh7ljRhfAH3nkVYI4LSUAz+syLFJDOS8VrkDJ17sLA w9S/lhlFPT3Fhx18L7aaLiEzZUKusbJgsSdRcIY8feQ7Oy4yvNUGclGlBIgvN+X8OJ UVITQ9jDHWBZYXM5FMN51oaZxa9qkVOVe+hhugYA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoph Hellwig , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 4.9 110/139] PM: hibernate: remove the bogus call to get_gendisk() in software_resume() Date: Tue, 27 Oct 2020 14:50:04 +0100 Message-Id: <20201027134907.364052407@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134902.130312227@linuxfoundation.org> References: <20201027134902.130312227@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christoph Hellwig [ Upstream commit 428805c0c5e76ef643b1fbc893edfb636b3d8aef ] get_gendisk grabs a reference on the disk and file operation, so this code will leak both of them while having absolutely no use for the gendisk itself. This effectively reverts commit 2df83fa4bce421f ("PM / Hibernate: Use get_gendisk to verify partition if resume_file is integer format") Signed-off-by: Christoph Hellwig Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- kernel/power/hibernate.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index 3c775d6b7317f..7b393faf930f8 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c @@ -834,17 +834,6 @@ static int software_resume(void) /* Check if the device is there */ swsusp_resume_device = name_to_dev_t(resume_file); - - /* - * name_to_dev_t is ineffective to verify parition if resume_file is in - * integer format. (e.g. major:minor) - */ - if (isdigit(resume_file[0]) && resume_wait) { - int partno; - while (!get_gendisk(swsusp_resume_device, &partno)) - msleep(10); - } - if (!swsusp_resume_device) { /* * Some device discovery might still be in progress; we need -- 2.25.1