linux/drivers/most
Victoria Votokina a8cc9e5fcb most: usb: hdm_probe: Fix calling put_device() before device initialization
The early error path in hdm_probe() can jump to err_free_mdev before
&mdev->dev has been initialized with device_initialize(). Calling
put_device(&mdev->dev) there triggers a device core WARN and ends up
invoking kref_put(&kobj->kref, kobject_release) on an uninitialized
kobject.

In this path the private struct was only kmalloc'ed and the intended
release is effectively kfree(mdev) anyway, so free it directly instead
of calling put_device() on an uninitialized device.

This removes the WARNING and fixes the pre-initialization error path.

Fixes: 97a6f772f3 ("drivers: most: add USB adapter driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Victoria Votokina <Victoria.Votokina@kaspersky.com>
Link: https://patch.msgid.link/20251010105241.4087114-3-Victoria.Votokina@kaspersky.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-22 08:04:43 +02:00
..
Kconfig most: tell what the MOST acronym means 2023-01-19 17:16:05 +01:00
Makefile
configfs.c staging: most: Replace all non-returning strlcpy with strscpy 2023-06-01 07:07:37 -07:00
core.c most: core: Drop device reference after usage in get_channel() 2025-08-19 12:57:34 +02:00
most_cdev.c most: remove usage of the deprecated ida_simple_xx() API 2024-06-24 22:25:08 -07:00
most_snd.c most: fix kernel-doc warnings 2023-01-19 17:16:01 +01:00
most_usb.c most: usb: hdm_probe: Fix calling put_device() before device initialization 2025-10-22 08:04:43 +02:00