From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 700FDC433EF for ; Mon, 14 Feb 2022 10:39:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348646AbiBNKjr (ORCPT ); Mon, 14 Feb 2022 05:39:47 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:48416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349991AbiBNKgs (ORCPT ); Mon, 14 Feb 2022 05:36:48 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC3569FE8; Mon, 14 Feb 2022 02:03:14 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 18CEFB80CE1; Mon, 14 Feb 2022 10:03:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AADEC340E9; Mon, 14 Feb 2022 10:03:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644832991; bh=PJHeGXva5+VseX84sjTYD+TkWsdaeyJBakqXYhk9zg0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IscxmPCbbTq3aOrEYjGoSNd0gFPwiLmw03H2tznvuhabGUh5xFEWftmvkO4PXYoJX etZl34CpfcWmf6sHDKlNFGjUCE/FCV40Uth9YBg6YKFKL0tY66NIvPlVyL6c39riMC auqWvK2YjQtrY6ONXvD+LEHVyZc1AUhQq1qiFAZs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vineeth Vijayan , Peter Oberparleiter , Jan Hoeppner , Vasily Gorbik Subject: [PATCH 5.16 190/203] s390/cio: verify the driver availability for path_event call Date: Mon, 14 Feb 2022 10:27:14 +0100 Message-Id: <20220214092516.709162994@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092510.221474733@linuxfoundation.org> References: <20220214092510.221474733@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: Vineeth Vijayan commit dd9cb842fa9d90653a9b48aba52f89c069f3bc50 upstream. If no driver is attached to a device or the driver does not provide the path_event function, an FCES path-event on this device could end up in a kernel-panic. Verify the driver availability before the path_event function call. Fixes: 32ef938815c1 ("s390/cio: Add support for FCES status notification") Cc: stable@vger.kernel.org Signed-off-by: Vineeth Vijayan Suggested-by: Peter Oberparleiter Reviewed-by: Jan Hoeppner Reviewed-by: Peter Oberparleiter Signed-off-by: Vasily Gorbik Signed-off-by: Greg Kroah-Hartman --- drivers/s390/cio/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -1194,7 +1194,7 @@ static int io_subchannel_chp_event(struc else path_event[chpid] = PE_NONE; } - if (cdev) + if (cdev && cdev->drv && cdev->drv->path_event) cdev->drv->path_event(cdev, path_event); break; }