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=1796380175; b=BlLG2Jx+RFwh8YD+Mll+WbwHiySt3p40IchZylwcOaoWb8Zy1KfV33UgjqDs4lj2Yq+e 9YtHUgIbRvlBWscVXfkuPev30/iSO4H5Sv/tuyMFfSfHxWFAe2n7Q5NKBDgowtsQbYys8 PsYtv6CmSQZDDkJOQMPYJr6SWcTNiRrYzOc8WJ9xYHun557ej+h0BrnCAwuPRaTOwm4qV grk7pgIfje7r+/oYgFIYmOTA55oPiR74S5yAcEkOAXhEyY1nZj5KadqJTuzTdYAlJY+MK JFL0qP5vjJb55//M+w4DiDsHVW2Xzmyw42YLrlgdQ74WtVCtDzf+1wfkdOcmAyH/glQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380175; 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=CSdHOicI4EiZSZbROtqS+3WIDIILGz8PhfiG/DdT/oY=; b=dvWMC3LtMaMmQ9oXVNvZrT6aPodagFZrInSLFtimIBxssomfbuIQYFZUJ6KqBKMOvN2G g6m9kpfncpAYuBiMOSrjI1KoG2Vhu11/juve2avKs2bcvRchyoPcLX29qBZz0xregirCd WYws3+AEDl3tkSYGJZ/Um5T8i9zl4JtBWDQWIiayh3q5H19OyLYt0xz2DdaU8mh2QaGRn 9zqHqcLUDd9v6YAMcypa7Afqa9AOL62Rlw3EFTauobKRVcPi4+6G5HjOxt/BP4M+0xvGg Z1lDk2juKrlsta7piQ3slXJKI1in1hA0fJ7OAV1YL1OdOSTRZP0ApuuuS25mCY6FDXQ== 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=HQwOX69T; 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 6F440606A32F; Fri, 4 Dec 2026 10:29:35 +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=HQwOX69T Received: by smtp.kernel.org (Postfix) with ESMTPSA id A76631F000CE; Fri, 4 Dec 2026 10:29:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380175; bh=CSdHOicI4EiZSZbROtqS+3WIDIILGz8PhfiG/DdT/oY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=HQwOX69TpZ5iDluZcLRYwOqM5j/rSXT89V8WyMruN7PKmVYRpKBGJD18B70YrRwc+ N7gbaQftLurYOy6qiirqSTtGOR9tIwrj2k2u8YDnuabo41LMZ6gOLM9Pa8uOtx1pf2 SLo7byfpKNSgBeKRlbGVivnAFeVIZM1bVLYSuM0E= 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 7.3 159/742] HID: sensor: custom: Register enable attribute after misc device Date: Fri, 4 Dec 2026 19:00:23 +0900 Message-ID: <20261204100639.340152431@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@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 7.3-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 f9e604920ea76..4d7cb7994dd81 100644 --- a/drivers/hid/hid-sensor-custom.c +++ b/drivers/hid/hid-sensor-custom.c @@ -1059,20 +1059,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