From patchwork Mon May 10 10:16:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 433893 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21617C2B9FD for ; Mon, 10 May 2021 11:00:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0404661961 for ; Mon, 10 May 2021 11:00:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235103AbhEJLAC (ORCPT ); Mon, 10 May 2021 07:00:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:52982 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234099AbhEJKzw (ORCPT ); Mon, 10 May 2021 06:55:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E8D6B61627; Mon, 10 May 2021 10:43:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643426; bh=blTBK4coGOXJdU/M+D/vhYWK2BaNbcJiqs0sXBYGoYg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RzKk1zGPZEUcfzk1CAUHWaRX4UvqmMV+OkD9vO5ChDn53ZR0xTIgPKSgi9j2SV085 xSWBAaLr13PZxdwnV25wMBmviZihO9Uv4pQlDwmGfQJaR3fz/CAYxLe/4iwg7wMFu3 x9Akt1WyW3DC08Vd4OAuty7GXSuBIWhM+idabvzw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christian Ehrhardt , Vineeth Vijayan , Julian Wiedmann , Peter Oberparleiter , Heiko Carstens Subject: [PATCH 5.11 011/342] s390/cio: remove invalid condition on IO_SCH_UNREG Date: Mon, 10 May 2021 12:16:41 +0200 Message-Id: <20210510102010.480865544@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102010.096403571@linuxfoundation.org> References: <20210510102010.096403571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Vineeth Vijayan commit 2f7484fd73729f89085fe08d683f5a8d9e17fe99 upstream. The condition to check the cdev pointer validity on css_sch_device_unregister() is a leftover from the 'commit 8cc0dcfdc1c0 ("s390/cio: remove pm support from ccw bus driver")'. This could lead to a situation, where detaching the device is not happening completely. Remove this invalid condition in the IO_SCH_UNREG case. Link: https://lore.kernel.org/r/20210423100843.2230969-1-vneethv@linux.ibm.com Fixes: 8cc0dcfdc1c0 ("s390/cio: remove pm support from ccw bus driver") Reported-by: Christian Ehrhardt Suggested-by: Christian Ehrhardt Cc: Signed-off-by: Vineeth Vijayan Tested-by: Julian Wiedmann Reviewed-by: Peter Oberparleiter Tested-by: Christian Ehrhardt Signed-off-by: Heiko Carstens Signed-off-by: Greg Kroah-Hartman --- drivers/s390/cio/device.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -1525,8 +1525,7 @@ static int io_subchannel_sch_event(struc switch (action) { case IO_SCH_ORPH_UNREG: case IO_SCH_UNREG: - if (!cdev) - css_sch_device_unregister(sch); + css_sch_device_unregister(sch); break; case IO_SCH_ORPH_ATTACH: case IO_SCH_UNREG_ATTACH: