From patchwork Fri Jun 8 18:39:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Henrique Cerri X-Patchwork-Id: 926981 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 412WR73tzFz9ry1; Sat, 9 Jun 2018 04:39:31 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1fRMIG-0007Rb-PQ; Fri, 08 Jun 2018 18:39:24 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1fRMIE-0007R4-Qv for kernel-team@lists.ubuntu.com; Fri, 08 Jun 2018 18:39:22 +0000 Received: from mail-qt0-f199.google.com ([209.85.216.199]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1fRMIE-0007bB-GS for kernel-team@lists.ubuntu.com; Fri, 08 Jun 2018 18:39:22 +0000 Received: by mail-qt0-f199.google.com with SMTP id d14-v6so13000031qtn.3 for ; Fri, 08 Jun 2018 11:39:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=dpVjxGH0rjSSUJukpXotlZhSkXcdtKNz9Ye7ylV942c=; b=qQ30Qn3tku1IYf8ncc9BRwSoRgzYBFB5TVo978YgZK45WsuyAKt6o7myupaqghVLM4 Qxwb9s1WYbsOWY4L4fUq2GFQCvoi9HjjBW52MxlXVfaO+FEwM79SfL8hU5L11von0N+J zXsAuc2Nf7MbqQIwHYgRdsmtSGmmB2J08yVEzWlyIsP3V8raMsczTaHEOmM23e6re8rT b7ofBNaBiFscCVTYrg8+bo2YRgof8RBcQX7a0Herq0s845RB+bGyoJJTYh54SRYBgW2p WlhhSXjSta4+AaWl40AoG0ISlyghJQGJoanH+aBilI1CFn+b2pEtpSn26B3S77kesVx/ zXYA== X-Gm-Message-State: APt69E3Q5pkc50/aILI/hiFnpj5nqEodCqWawg9kYmKkiGihkD2UoLkb mNWB+Kf0ZeXvz330vs1yQqCZQNP2128DQTjvwdGPust83689Ksa1bK4v904HpKgHR9hY/MaWIQl JvmB6YPvkSrXI5XAfF9whX97H5ynh04j45ReGGgVW X-Received: by 2002:a37:be44:: with SMTP id o65-v6mr6114486qkf.439.1528483161240; Fri, 08 Jun 2018 11:39:21 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLtQLJ/KcwfRlj1OAONAryRz4Fx8qbY3lshjmNkWqCzM9Wr4rBrpYEFn5o2apcLa0pHzsVQlA== X-Received: by 2002:a37:be44:: with SMTP id o65-v6mr6114474qkf.439.1528483161012; Fri, 08 Jun 2018 11:39:21 -0700 (PDT) Received: from localhost.localdomain ([179.97.166.78]) by smtp.gmail.com with ESMTPSA id k2-v6sm35111688qkl.95.2018.06.08.11.39.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Jun 2018 11:39:19 -0700 (PDT) From: Marcelo Henrique Cerri To: kernel-team@lists.ubuntu.com Subject: [SRU][Bionic][PATCH 2/3] PCI: hv: Remove the bogus test in hv_eject_device_work() Date: Fri, 8 Jun 2018 15:39:10 -0300 Message-Id: <20180608183911.24395-3-marcelo.cerri@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180608183911.24395-1-marcelo.cerri@canonical.com> References: <20180608183911.24395-1-marcelo.cerri@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Dexuan Cui BugLink: http://bugs.launchpad.net/bugs/1758378 When kernel is executing hv_eject_device_work(), hpdev->state value must be hv_pcichild_ejecting; any other value would consist in a bug, therefore replace the bogus check with an explicit WARN_ON() on the condition failure detection. Signed-off-by: Dexuan Cui [lorenzo.pieralisi@arm.com: updated commit log] Signed-off-by: Lorenzo Pieralisi Reviewed-by: Michael Kelley Acked-by: Haiyang Zhang Cc: Vitaly Kuznetsov Cc: Jack Morgenstein Cc: Stephen Hemminger Cc: K. Y. Srinivasan (cherry picked from commit fca288c0153b2b97114b9081bc3c33c3735145b6) Signed-off-by: Marcelo Henrique Cerri --- drivers/pci/host/pci-hyperv.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c index f5fe4c38aee2..5eb7954ee584 100644 --- a/drivers/pci/host/pci-hyperv.c +++ b/drivers/pci/host/pci-hyperv.c @@ -1854,10 +1854,7 @@ static void hv_eject_device_work(struct work_struct *work) hpdev = container_of(work, struct hv_pci_dev, wrk); - if (hpdev->state != hv_pcichild_ejecting) { - put_pcichild(hpdev, hv_pcidev_ref_pnp); - return; - } + WARN_ON(hpdev->state != hv_pcichild_ejecting); /* * Ejection can come before or after the PCI bus has been set up, so