Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp732102imm; Thu, 13 Sep 2018 06:59:39 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbMa3N1JZn1YrNkuYTl20RdeLrz2v0y80uYY8E6VCdC+stgk0+rFj2jHGXHcbukMWMoQDiJ X-Received: by 2002:a62:c218:: with SMTP id l24-v6mr7617626pfg.185.1536847179837; Thu, 13 Sep 2018 06:59:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536847179; cv=none; d=google.com; s=arc-20160816; b=OPZzz5EYI4UM5pBf+xr96D3TPi3771RzBNepoguA3DOLYxr8Xs7OeXyo1XDzkJ/U9H r7xYMJ/MXM68z/KDf6D/5PeNltaA1c3teKsFOFckrdfexqoj1U0NbUyycTbM0wARbGq/ ps18ZbAt/Rj89V9Cok3FEt6tZzaMyvlG3yHy5MpgQlVsHaXRWq+AsMuSkFf1F0lozBux S1z9qIcUw87SCsF4ZBlF99Qpt0bSoyc7JZzy23DC4jhm4PXZgduRC27Xdc2Rev0O3gGb C/DVZPvut449r0YfDkAZJ+pvkdygqh0Dm/XkvlujuJATqhwO02C1PTDy6+2vXvB++3iT jYpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=1XizvfRkkSwsp7eChLunNp1KFsPHvVL5yMU4LngAkvM=; b=WTuhYFW9X/S1nFFSfWHISnKLXHTzlKVHbxKhBREJVz++vZaf79vkxHm8V2FwfJWbg2 2ZuVjXGhtu34h3FXanK6l+4w5hBLQsuPb/u2tArL3llUbyzaLhGSjeWIYMAfXnn0HJct z71HRVOO3qUHWBdhjlDyK4HPU3Bjx5fmrEiPTXqohpCnzsqOpDfubLWWPmPLqkojDUKK FuSGhOEkrg3JC0ngtHL5njrVcoFHxdndmDjn4cMI3CqLhbY0TFx9mJMLG1jyh2lcRkdx qBPbG/pqa95nDeYtJPKCAUWuYtwNMROzuiaqE1QH46sEi1BnzUbWssSGhZUxKy4pjIu6 N2JA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n184-v6si4568712pga.98.2018.09.13.06.59.24; Thu, 13 Sep 2018 06:59:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731540AbeIMTHb (ORCPT + 99 others); Thu, 13 Sep 2018 15:07:31 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34444 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728566AbeIMTHa (ORCPT ); Thu, 13 Sep 2018 15:07:30 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8D28AD19; Thu, 13 Sep 2018 13:57:53 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jan Hoeppner , Stefan Haberland , Martin Schwidefsky , Sasha Levin Subject: [PATCH 4.18 104/197] s390/dasd: fix panic for failed online processing Date: Thu, 13 Sep 2018 15:30:53 +0200 Message-Id: <20180913131845.707504089@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131841.568116777@linuxfoundation.org> References: <20180913131841.568116777@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stefan Haberland [ Upstream commit 7c6553d4db03350dad0110c3224194c19df76a8f ] Fix a panic that occurs for a device that got an error in dasd_eckd_check_characteristics() during online processing. For example the read configuration data command may have failed. If this error occurs the device is not being set online and the earlier invoked steps during online processing are rolled back. Therefore dasd_eckd_uncheck_device() is called which needs a valid private structure. But this pointer is not valid if dasd_eckd_check_characteristics() has failed. Check for a valid device->private pointer to prevent a panic. Reviewed-by: Jan Hoeppner Signed-off-by: Stefan Haberland Signed-off-by: Martin Schwidefsky Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/s390/block/dasd_eckd.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c @@ -1780,6 +1780,9 @@ static void dasd_eckd_uncheck_device(str struct dasd_eckd_private *private = device->private; int i; + if (!private) + return; + dasd_alias_disconnect_device_from_lcu(device); private->ned = NULL; private->sneq = NULL;