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 9D661C433F5 for ; Mon, 14 Feb 2022 10:17:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346183AbiBNKR3 (ORCPT ); Mon, 14 Feb 2022 05:17:29 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346274AbiBNKPn (ORCPT ); Mon, 14 Feb 2022 05:15:43 -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 28E147B561; Mon, 14 Feb 2022 01:52:41 -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 C46E0B80DC8; Mon, 14 Feb 2022 09:52:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7F1DC340E9; Mon, 14 Feb 2022 09:52:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644832358; bh=PJHeGXva5+VseX84sjTYD+TkWsdaeyJBakqXYhk9zg0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v1SXIjjjibVtD3tayCiI7Kf1wh2A1pw+SUccf9ZUXPO0IMYGN4veb80SbNwZcmygN G3lp2+x9K/opuQOXKVIUARmURpQ3sIS6BqtBl0ozBhKOiVuPhAfn6QxubiZZLGWaHq Ic+CNlKFnX3+h90HiN5E3zhkpF1k3Pi3vxMY63o8= 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.15 160/172] s390/cio: verify the driver availability for path_event call Date: Mon, 14 Feb 2022 10:26:58 +0100 Message-Id: <20220214092511.914738642@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092506.354292783@linuxfoundation.org> References: <20220214092506.354292783@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; }