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 9623942FCC3; Thu, 16 Jul 2026 14:34:33 +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=1784212474; cv=none; b=NJPOVDeyVeQsAci8LsLUXhKpGhYTn9R/4aGYLa8heYa9MvIDNcOM0hc4u+UoT3lt+irt0EQR4m4ud36i+BfNcMCCKi+VB4/tK1BAs6xMsxo57thaEEv9H8EsiS53OAyFvojsVxzxbFFGbIXhTBW+IypZoL4SVEctBEInl3qPnsk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784212474; c=relaxed/simple; bh=BRXDwnI+JhKmK8YddEgDWQAGt1P0qMXxERNu8b5m7Oo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Oz7IvFtYTH9cGYnDcnVepJ1dbgFoXC4/30pXIjzMIHRlFBhGC1e423mM/uqxu45boRldlAenYEIvEb0Ocymo8We+DrE4jMz/DrgrqJPbFpluIbbX425Nas4oEP9sOU2EJyiiSJ4Bz/5zbGKWDWmzsxnocudZaxoRvs5/kluUJ5I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=GdLvX/9E; 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="GdLvX/9E" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06BB71F000E9; Thu, 16 Jul 2026 14:34:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784212473; bh=ek5YgTlaoa8eBoitr66CE2rLQekQUZcIJ437Hzv51mA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=GdLvX/9EQfjf9kzfEiJNx9U5HjpBllZM31y3o7spdpI/JYOshyDWmK2pWZNKxRjI4 mTki1r9HCHDIbY8nEc7Zu/2UINRo0w7GOdV5c9hG6FWf5WGM3+OIunlRqbGk5qLzZ7 112D0oQdLK/IJpH9E8sab+GR5jaJ0UKXvUneUhEA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Florian Fuchs , Dmitry Torokhov Subject: [PATCH 6.12 342/349] Input: maplemouse - set driver data before registering input device Date: Thu, 16 Jul 2026 15:34:36 +0200 Message-ID: <20260716133040.962728274@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260716133033.287196923@linuxfoundation.org> References: <20260716133033.287196923@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.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dmitry Torokhov commit 738f24bbbc95dd50cb4229d1ed62a05f29db2bda upstream. Set maple driver data before calling input_register_device() to ensure that it is available if the device is opened immediately and the callback is triggered. Cc: stable@vger.kernel.org Assisted-by: Antigravity:gemini-3.5-flash Tested-by: Florian Fuchs Link: https://patch.msgid.link/akNXw45L_8bxD6QV@google.com Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/mouse/maplemouse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/input/mouse/maplemouse.c +++ b/drivers/input/mouse/maplemouse.c @@ -88,6 +88,8 @@ static int probe_maple_mouse(struct devi mse->dev = input_dev; mse->mdev = mdev; + maple_set_drvdata(mdev, mse); + input_set_drvdata(input_dev, mse); input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); input_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) | @@ -103,12 +105,12 @@ static int probe_maple_mouse(struct devi goto fail_register; mdev->driver = mdrv; - maple_set_drvdata(mdev, mse); return error; fail_register: input_free_device(input_dev); + maple_set_drvdata(mdev, NULL); fail_nomem: kfree(mse); fail: