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=1796386308; b=Esxr5uhDZ8I8cQH6ASFusCrkQzLNHosH2V2McTvT2uE/kNTUVnDogu7sCzd7U0151jfw IO0a+PJa8hv5L/+91OINvQUG3fKm5Ax+fG3yxUChrMHN5bLz5nKOypothPdA5ViiYGklJ UYVYBmIF8Pg6HgLVOIgxhrwL/HoUcpC8eK03ASvJplfEUnzyy5dvdsnkAGQLZXpsbSZK6 jd1834BzALGSALmlflhsJFTEq3/a6cVUvn8cT3sQfRZII8BjaxXMcJs7txMizDukeFaWa +I9MZTQx2PuvEqSWlbVROOamMlyYlUK7QwwrhQBquCrlA0eo7QozdO0PThVhsCQF6yw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796386308; 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=bL8Z3ph9s/aPSKuJEoQ4KVWucU44IMW34KeqvtsbNpg=; b=oZOAeWelGg+Fvga8MlIH1ZO418Q5R1pwiPWEvpMArXm3QDjWS5ueSVYzFxTk/wRN0Oue 6ReB+dcbxiAxUjdfdBMzyZwa6k3u+OUggmbGqUv+MGy5f/DwCAO5zx/hqpIyWcT7PZ6T+ m9tyH16D55GPGwRzoNIG52n0EWRc07L7tQusGW7K6mt6Hq+w1qpgwfocIYzhH7Rdtva8N 7DTVYEnAfJLuXaNZW5L6D6pckQ1ivvJok0dSsb8vC6JdQ9LdUqchYXh+zDi1+CwZJSJeW Z4F+UvZi45LOPHcLrAFCxSV1Wmln2KXWow4ouQHZvzx2dC9NHziBuyIEKFb7zvMSowQ== 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=W0mMYbDg; 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 E47DD606A322; Fri, 4 Dec 2026 12:11:47 +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=W0mMYbDg Received: by smtp.kernel.org (Postfix) with ESMTPSA id 628CE1F000CE; Fri, 4 Dec 2026 12:11:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796386307; bh=bL8Z3ph9s/aPSKuJEoQ4KVWucU44IMW34KeqvtsbNpg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=W0mMYbDgcFBcXjDPa0sF0hx31N1UXJM4GAqzIZEujO+36MP5xsP1pPCLka5b1TQD2 AWmJsQiBDyjIyAI+bvwjV88rwnI0nX9dhuGhCWkNUzmajjP0rqagr9bgfC9uGf4B+5 aMt5ib1X6TLsdo7o5epwS5k8v9fTGdu2fXzOqyfQ= 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.6 0909/1167] HID: sensor: custom: Register enable attribute after misc device Date: Fri, 4 Dec 2026 19:05:36 +0900 Message-ID: <20261204100725.879209669@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@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.6-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 ec8d5426e939d..6410ce4d70062 100644 --- a/drivers/hid/hid-sensor-custom.c +++ b/drivers/hid/hid-sensor-custom.c @@ -1060,20 +1060,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