diff options
| author | Victoria Votokina <[email protected]> | 2025-10-10 10:52:41 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2025-10-22 06:04:43 +0000 |
| commit | a8cc9e5fcb0e2eef21513a4fec888f5712cb8162 (patch) | |
| tree | 7842cd3811250cd407cb3ac7a797d6099e4253d1 /scripts/basic/docproc.c | |
| parent | most: usb: Fix use-after-free in hdm_disconnect (diff) | |
| download | kernel-a8cc9e5fcb0e2eef21513a4fec888f5712cb8162.tar.gz kernel-a8cc9e5fcb0e2eef21513a4fec888f5712cb8162.zip | |
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: 97a6f772f36b ("drivers: most: add USB adapter driver")
Cc: stable <[email protected]>
Signed-off-by: Victoria Votokina <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'scripts/basic/docproc.c')
0 files changed, 0 insertions, 0 deletions
