From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC1B3394785; Sat, 17 Oct 2026 16:56:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792256205; cv=none; b=Lazzyv22XaGo5jiQd20JOYyvQPctLf1K7Z2Z5xW5VcZ6Fmveyu3/LUnDNlTCKYl2xghrdOkje75A77s0QM1FniNtLPrn5F2wzUTyhBbY6Y5HBb2EC/owwd5F9iVBWIzCcu6DKRFYHukmYb7UVNMcZv8gcpqeBO50x6IusxdpRPE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792256205; c=relaxed/simple; bh=xmnjwWTbFc9YUK21CqJAL+BunstMu9ZBVtascjRBY74=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qio5BHloBqLcropPzG/WsDLZ51wBhVEV+3ge/klmWcfaBKXr0sku9wTN1HWBc8Oo94HROhu8XWoT+ahCX6VGI5zS33qraXXVTUC8cWJ/3TLqSnK0ko8dWmaW14c4AzMQbUHrBc4EKWFwsITyfyL1cYL9IGN6YYvrWfcqejFx1Tw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1HK3v/uw; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="1HK3v/uw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 127B41F000C4; Sat, 17 Oct 2026 16:56:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792256204; bh=J0eJtVxXZ2fptjSFmtzsk7t2QAC3Qblj2UOBI7kK3pY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=1HK3v/uwxi1jTRPMVEwBoho75FATM0HMTwfTLss6rlXpJQmsB6OxVJiUsNr70OlSx emp6M96YbXLS1tyyzm61DCuomxqOxJNYu0XXHu3vGG5vtb3o3MQevhHtkmyvbGNAx0 J7B2U60A5d+ZrDh1anW2KJfO5cV6t6uJjQxeYPvQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Chen Changcheng , Jiri Kosina , Sasha Levin Subject: [PATCH 6.6 0157/1674] HID: alps: unregister DualPoint Stick input device on remove Date: Sat, 17 Oct 2026 17:40:29 +0200 Message-ID: <20261017160435.189788724@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261017160431.119607952@linuxfoundation.org> References: <20261017160431.119607952@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chen Changcheng [ Upstream commit aa9dde93e05a837645fdfd577eea71f0733f0694 ] alps_input_configured() allocates a second input device ("DualPoint Stick") with input_allocate_device() and registers it, but the alps_driver struct has no .remove handler and input2 is not tracked in hdev->inputs. The default remove path (hid_hw_stop -> hidinput_disconnect) only iterates hdev->inputs, so input2 is never unregistered and leaks on every device removal. Add a .remove handler that stops the device first (preventing URB callbacks from touching input2 during teardown) and then unregisters input2. Fixes: 2562756dde55 ("HID: add Alps I2C HID Touchpad-Stick support") Cc: stable@vger.kernel.org Signed-off-by: Chen Changcheng Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/hid-alps.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/hid/hid-alps.c b/drivers/hid/hid-alps.c index 35df84426196c..25da180175007 100644 --- a/drivers/hid/hid-alps.c +++ b/drivers/hid/hid-alps.c @@ -825,6 +825,24 @@ static int alps_probe(struct hid_device *hdev, const struct hid_device_id *id) return 0; } +static void alps_remove(struct hid_device *hdev) +{ + struct alps_dev *data = hid_get_drvdata(hdev); + + /* + * input2 ("DualPoint Stick") is allocated separately and is not + * tracked in hdev->inputs, so the default remove path + * (hid_hw_stop -> hidinput_disconnect) does not unregister it. + * + * Stop the device first so that no URB callback can touch input2 + * while it is being unregistered, then drop it explicitly. + */ + hid_hw_stop(hdev); + + if (data->input2) + input_unregister_device(data->input2); +} + static const struct hid_device_id alps_id[] = { { HID_DEVICE(HID_BUS_ANY, HID_GROUP_ANY, USB_VENDOR_ID_ALPS_JP, HID_DEVICE_ID_ALPS_U1_DUAL) }, @@ -847,6 +865,7 @@ static struct hid_driver alps_driver = { .input_configured = alps_input_configured, .resume = pm_ptr(alps_post_resume), .reset_resume = pm_ptr(alps_post_reset), + .remove = alps_remove, }; module_hid_driver(alps_driver); -- 2.53.0