From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796388989; b=YOP/Th1U51uXKYx1oDXs5xb1N2gNEkWpSZ11LwPdHUNBzJq8l/2MnUHtUGbUACnX7g/1 csbca7ooaNPul3yPiwFexu+X5MlumiV8Xu4UXcN0iGbmuussz8rsLPxlfvauhxbaorqWj n99YI/qqROQ6mNi3KrK4zefX1jT4Ew+CVurvBAyFCcMkfjAINGxGTxvgG0HOseIf4xu5E 7ooHezKP+tAQjQ2kJPjT6tUYivZCUTrb7gu/JQoGcRgM0hRNa23jWtVdQeJtthUAJovUA MLnznBjQuX/NrIisZTjx8D1XL8RIRu23pQv+NWp13C0q/wRQxzL3j+ekolNXlpo/87g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388989; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=b/SX/44ZQwxRwzn6wM+UvRRNFZ/13xny5mQ+/laLky8=; b=t7s90vLuLJfxqYe3DWOlkme7Qg78noPPOTtq1NhoVgddkE+wdOWiLoTibbER3hRiB+o6 MCLllgFMUqHJ9gsnTpfkL4fDWW6CeuOHps2fS7ABdlhfo+3ZAi3ntmGaHStIf5eif+npB FrJl7LFasIF/UCcAq3pbkKqI/jQ07iL89XcybsVMC4LinYzAIcnK37443WiB4JKAuXC9L IcgOI/vXFST8TAcmbjqZriuiyztfs2S7Bc2XM7nWaPsAFobMizpR9SZ3mCjlFOnbRmXXf MFJ0RLwPw5F4X9GLMaPdIN60Vicn+FBzXRff9sZ9ydABSFFQu9jH/W7nz6lFfrJqgSA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=BrhhbtcD; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6FA59606A322; Fri, 4 Dec 2026 12:56:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=BrhhbtcD Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60F171F00934; Fri, 4 Dec 2026 12:56:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388988; bh=b/SX/44ZQwxRwzn6wM+UvRRNFZ/13xny5mQ+/laLky8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BrhhbtcD119jzDk/6MD7RzKVXIFCFXrZE1XeWAYZJ46J6fefgRGYa6yqQzPiBPAi6 iGuRC0BABAkWoneuJ4egwA9+1EGnkf8lHiPYG82PkoM7yd/f3eG03f5KUb7tF6cJCA qHsEJo0+q6v6I6Vi1sPUbGCPgxckARUHFeSYKE8o= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Semyon Maryasin , Zhang Lixu , Srinivas Pandruvada , Jonathan Cameron , Jiri Kosina , Sasha Levin Subject: [PATCH 6.1 0825/1059] HID: sensor: custom: Register enable attribute after misc device Date: Fri, 4 Dec 2026 19:05:56 +0900 Message-ID: <20261204100705.394109944@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Srinivas Pandruvada [ Upstream commit c6ebe27e3ba09edf956139c741b38e8432be3f67 ] Register the enable_sensor sysfs group only after misc-device setup succeeds. This prevents userspace from opening the sensor hub while probe can still fail, which would otherwise leave the hub open reference unbalanced on unwind. Fixes: 4a7de0519df5 ("HID: sensor: Custom and Generic sensor support") Reported-by: Semyon Maryasin Closes: https://lore.kernel.org/all/CAM2dg7ewfVJSP4rFyhkCB1Rmd1+X56sAg=eUdbPthG2xrLqwQQ@mail.gmail.com/ Tested-by: Semyon Maryasin Tested-by: Zhang Lixu Signed-off-by: Srinivas Pandruvada Reviewed-by: Jonathan Cameron Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/hid-sensor-custom.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/hid/hid-sensor-custom.c b/drivers/hid/hid-sensor-custom.c index 018ab0293d33e..791f7f42bf9f8 100644 --- a/drivers/hid/hid-sensor-custom.c +++ b/drivers/hid/hid-sensor-custom.c @@ -964,20 +964,19 @@ static int hid_sensor_custom_probe(struct platform_device *pdev) if (ret) goto err_remove_callback; - ret = sysfs_create_group(&sensor_inst->pdev->dev.kobj, - &enable_sensor_attr_group); + ret = hid_sensor_custom_dev_if_add(sensor_inst); if (ret) goto err_remove_attributes; - ret = hid_sensor_custom_dev_if_add(sensor_inst); + ret = sysfs_create_group(&sensor_inst->pdev->dev.kobj, + &enable_sensor_attr_group); if (ret) - goto err_remove_group; + goto err_remove_dev_if; return 0; -err_remove_group: - sysfs_remove_group(&sensor_inst->pdev->dev.kobj, - &enable_sensor_attr_group); +err_remove_dev_if: + hid_sensor_custom_dev_if_remove(sensor_inst); err_remove_attributes: hid_sensor_custom_remove_attributes(sensor_inst); err_remove_callback: -- 2.53.0