Return-Path: Received: from mail-bl2nam02on0109.outbound.protection.outlook.com ([104.47.38.109]:57851 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727675AbeH3WOb (ORCPT ); Thu, 30 Aug 2018 18:14:31 -0400 From: Sasha Levin To: "stable@vger.kernel.org" CC: Stefan Haberland , Martin Schwidefsky , Sasha Levin Subject: [PATCH AUTOSEL 4.14 41/67] s390/dasd: fix panic for failed online processing Date: Thu, 30 Aug 2018 18:11:07 +0000 Message-ID: <20180830180918.36327-41-alexander.levin@microsoft.com> References: <20180830180918.36327-1-alexander.levin@microsoft.com> In-Reply-To: <20180830180918.36327-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: 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 --- drivers/s390/block/dasd_eckd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.= c index 4f966613b36e..4c7c8455da96 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c @@ -1778,6 +1778,9 @@ static void dasd_eckd_uncheck_device(struct dasd_devi= ce *device) struct dasd_eckd_private *private =3D device->private; int i; =20 + if (!private) + return; + dasd_alias_disconnect_device_from_lcu(device); private->ned =3D NULL; private->sneq =3D NULL; --=20 2.17.1