Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp420774rwd; Mon, 12 Jun 2023 16:06:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ61ckcioiQ1lI0X3qVVhNjLHcseBj4RwVKgkLwpx4GYYQoD1O4SuZaaJs5IlyxO+Cc0AiKP X-Received: by 2002:aa7:d58c:0:b0:514:9c09:3c96 with SMTP id r12-20020aa7d58c000000b005149c093c96mr6321770edq.15.1686611166867; Mon, 12 Jun 2023 16:06:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686611166; cv=none; d=google.com; s=arc-20160816; b=mVqD6RAOQFpkC2a/GjST4eAMPPejPICbcT7Ho4upHibgdLD/mk+mxEBQgIvEI6M0Zr AlMHJohsp8mTN7SSwMoQCRKbihlUxiImJeh9KkLm6y+9FQEL05s6d9wnJBeBdppYL+/r 81goNddPVO9qVqi28NvegsxTv3tIatApR73Huo7hIdcEXt/c7xnWZtVnYeG2Hs/5M1r1 mTzRPQ8gMFW1TNd4z9ySd7VRNBg0v58A47eH/kCXrgdKZHr9b6phFRUxAJW1JIVxQ9tu JSQhfCBjEJEB4LtbW6yukISsxDIu48p0nUHUV/zupHrqBOgwUG2lwsF17zYecubPpKOG L/eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TFpWC3yzw4z1tyRKbOkU323jj4cV/McIQVAfSmc7Fgs=; b=QuH4rYAV/cVdVfc4H65B6OnP7/GkzALvhMOnPFk3Yg/5EzoceopaQpoPsiAeA5MP67 Oid/dT/LJVQdZZHXlnrQz1x66q+0slbEwUjULWJ4x9xDE4rL3+5tyekP2JO/UQElcLtv 0T4ckKs1pS8q1S//HdNTZy1G4UlooF1dljY6V6FzQLNADi0g/pcOlUAePLuFh0Xd0MG4 U4eLGaSF3nIJCIz1wPpuU5vNL8BzTxM3zQV07PYxJFmtam/e4SpM0M3vGKhLl3fJNUPv 5aJ1tIyEgfD4zV0WXD7tuBjm4CshlqxwLOVin/EjUaIAPesZ76VeX2fQaX0+f/Ffoh5Q deCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cdegRwzG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q4-20020a056402032400b00514a14a94e5si6576350edw.175.2023.06.12.16.05.42; Mon, 12 Jun 2023 16:06:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cdegRwzG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232473AbjFLWkj (ORCPT + 99 others); Mon, 12 Jun 2023 18:40:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238008AbjFLWkh (ORCPT ); Mon, 12 Jun 2023 18:40:37 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F9D1171F; Mon, 12 Jun 2023 15:40:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686609636; x=1718145636; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=W0g3K9LOGENgGUyAE6TRJpAv9/VDpuKKRjJ9zM72D7k=; b=cdegRwzGWE9VoAhcMTJCeK+VZMCt6Ff/8GhAenx5zJPkbJJjdA9j/osB +FHh9dfSyHYrQh92/g0kuJwpmjwtGGpqvQ1MgnepQbZX26yB1QMWWkOnd GOPPACfq0o+pR2Z7dVu4s9wBRWngZRnP+pG7Qi62/IbOFV8ueuD7mOv0U bYkWV9YX8cehmWHp60srhdfxfZq2nd21hGS50nUh87WLFWO5a/jsLhO4k W9sRCu48FGM0W6qZHFTlwz3y0GLTI8wUlUgtmBRvW/z1DMfGA97VzPbqa dOxEkZ643vUDAiGcayMYqdosuoHl9sa/wyttODcFjHhyEoqt4Kc07jq0p A==; X-IronPort-AV: E=McAfee;i="6600,9927,10739"; a="347829710" X-IronPort-AV: E=Sophos;i="6.00,238,1681196400"; d="scan'208";a="347829710" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2023 15:40:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10739"; a="688805722" X-IronPort-AV: E=Sophos;i="6.00,238,1681196400"; d="scan'208";a="688805722" Received: from spandruv-desk.jf.intel.com ([10.54.75.8]) by orsmga006.jf.intel.com with ESMTP; 12 Jun 2023 15:40:35 -0700 From: Srinivas Pandruvada To: hdegoede@redhat.com, markgross@kernel.org Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Pandruvada Subject: [PATCH 1/2] platform/x86: ISST: Reset default callback on unregister Date: Mon, 12 Jun 2023 15:40:32 -0700 Message-Id: <20230612224033.2382527-2-srinivas.pandruvada@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230612224033.2382527-1-srinivas.pandruvada@linux.intel.com> References: <20230612224033.2382527-1-srinivas.pandruvada@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When multiple clients are registered and some of those modules are removed, the default IOCTL callback for those clients are still not NULL. Calling them will result in crash. Set the default IOCTL callback pointer to NULL on unregister. Signed-off-by: Srinivas Pandruvada --- drivers/platform/x86/intel/speed_select_if/isst_if_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/platform/x86/intel/speed_select_if/isst_if_common.c b/drivers/platform/x86/intel/speed_select_if/isst_if_common.c index e0572a29212e..352bf5118d17 100644 --- a/drivers/platform/x86/intel/speed_select_if/isst_if_common.c +++ b/drivers/platform/x86/intel/speed_select_if/isst_if_common.c @@ -831,6 +831,7 @@ void isst_if_cdev_unregister(int device_type) { isst_misc_unreg(); mutex_lock(&punit_misc_dev_open_lock); + punit_callbacks[device_type].def_ioctl = NULL; punit_callbacks[device_type].registered = 0; if (device_type == ISST_IF_DEV_MBOX) isst_delete_hash(); -- 2.38.1