Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1121821pxx; Tue, 27 Oct 2020 08:44:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSwBfoX50RCYOwtlZHMdvDbpdmhQgY8+N8ych2Qj+L+VyI+//Tct8MqJtB2AcceVtjfvYe X-Received: by 2002:a50:dec5:: with SMTP id d5mr2984798edl.362.1603813497630; Tue, 27 Oct 2020 08:44:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603813497; cv=none; d=google.com; s=arc-20160816; b=q5gBUpC38t2XHKJjcyodcm9WgPJz55kECTIfn8lrsDK1wF45JUm6wlLIMlfI01KGak KL9z/d0EbtU1V88Cw13cOXKtkWB+xpwNzlwqzWffaYMY5JZ2VLcLuA3btv5nIJEHS60z FE7zncNJvDaYob566zA5rq8Nmh+VToHjGI0ZQzWuNa+euqxob+ubhQg48koTmr5OiHGh 2JxUtMLA+FXlteO1OfHRGtTnzl3MX2We0qx2tFJgWyNE+fnNubkpKdlA0On6EI3sDFHp FVR64fqUcaleRUjhTcRVDkx41BuhHEixwYounwP5ahxa7m2owLWCme9PHB+sPdatG6bG dS6g== 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=I26dchohy1sdN/G9IFN8p1jjtwBJpuKIi838gq6+lAE=; b=yE5C2anXjGQ/6hmID017HY433HTRBYISwL0gf4ZJrkZNx6FvD6A4SlmADTGTIvuK2b NiGQpCUg3FgRWFyG/qU1qh+G+WPtuFlRzlqZ2aknz130efZ7v+vI6RceM/eQp0eZnFNN 4YvpOEnSSN58DWU8+4AIc2w3utCo/uQeqvGdqb4lIpKmuuxwScZkbzlwNU8hQfsc3EOv K0eH0dBpx82c7XlWCoLrehW9Dl2RW0ANi2dQogDTe1FO1g85JSkFdQOMXN4vul42VnQf aSFfDUzIVxqK64enGYjXa6CWQghJbJ9u8SkBEu1GdS2tSpieFhkB7W2aI4L30Nu+FF+u +2XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="K/P44+/c"; 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 f3si1062883eds.476.2020.10.27.08.44.34; Tue, 27 Oct 2020 08:44:57 -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="K/P44+/c"; 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 S1764070AbgJ0OqM (ORCPT + 99 others); Tue, 27 Oct 2020 10:46:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:45978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2899938AbgJ0OqE (ORCPT ); Tue, 27 Oct 2020 10:46:04 -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 4545D206E5; Tue, 27 Oct 2020 14:46:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809963; bh=KBactvEaUAEvgP4dzWOQ7pgiFuIZ3IED/EG1+Kb8/xQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K/P44+/cwP/FFmjeFEFnBhLSXDjOTPcimD4chdNpZRrFwFQ2Iwe0I/zRZByCsfJMh UlOhNAtp1QdvS87gIDv/oTCZ9CMF5ieKKfsz7H+FlaCl+QQRlcdA73zlx1azll+mNs DzmnZcZVlXuEiW50X0zIdP1SLGc+WshZT014hzhQ= 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 5.4 351/408] PM: hibernate: remove the bogus call to get_gendisk() in software_resume() Date: Tue, 27 Oct 2020 14:54:49 +0100 Message-Id: <20201027135511.302383270@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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 b6c5895ced36b..69c4cd472def3 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c @@ -839,17 +839,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