Re: [PATCH v2 2/7] HID: sensor: custom: Set owner for misc device

From: Joshua Crofts

Date: Thu Nov 05 2026 - 05:08:15 EST


On Wed, 4 Nov 2026 12:13:58 -0800
Srinivas Pandruvada <srinivas.pandruvada@xxxxxxxxxxxxxxx> wrote:

> Set .owner in the misc-device file operations so open file descriptors
> keep the module loaded until their release callbacks have completed.
>
> Fixes: 4a7de0519df5 ("HID: sensor: Custom and Generic sensor support")
> Reported-by: Семён Марьясин <simeon@xxxxxxxxxxxxx>
> Closes: https://lore.kernel.org/all/CAM2dg7ewfVJSP4rFyhkCB1Rmd1+X56sAg=eUdbPthG2xrLqwQQ@xxxxxxxxxxxxxx/
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@xxxxxxxxxxxxxxx>
> ---
> drivers/hid/hid-sensor-custom.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/hid/hid-sensor-custom.c b/drivers/hid/hid-sensor-custom.c
> index c2b425afd951..72e5639cb1d9 100644
> --- a/drivers/hid/hid-sensor-custom.c
> +++ b/drivers/hid/hid-sensor-custom.c
> @@ -719,6 +719,7 @@ static __poll_t hid_sensor_custom_poll(struct file *file,
> }
>
> static const struct file_operations hid_sensor_custom_fops = {
> + .owner = THIS_MODULE,
> .open = hid_sensor_custom_open,
> .read = hid_sensor_custom_read,
> .release = hid_sensor_custom_release,

Reviewed-by: Joshua Crofts <crofts@xxxxxxxxxx>

--
Kind regards,
Joshua Crofts