diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-12-07 12:08:14 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-12-07 12:08:14 +0300 |
commit | a3ab07c642b2d75e645b1a07464291e325a496e0 (patch) | |
tree | c5b423b58698a9c7b7a9545d085ab4e776fa610f /drivers/misc/habanalabs | |
parent | 888982a847520a5abfd036a0cc6426c55e71f76c (diff) | |
parent | 0477e92881850d44910a7e94fc2c46f96faa131f (diff) | |
download | linux-a3ab07c642b2d75e645b1a07464291e325a496e0.tar.xz |
Merge 5.10-rc7 into char-misc-next
We want the fixes in here, and this resolves a merge issue with
drivers/misc/habanalabs/common/memory.c.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/habanalabs')
-rw-r--r-- | drivers/misc/habanalabs/common/device.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c index c9011541c647..5871162a8442 100644 --- a/drivers/misc/habanalabs/common/device.c +++ b/drivers/misc/habanalabs/common/device.c @@ -242,16 +242,16 @@ delete_cdev_device: static void device_cdev_sysfs_del(struct hl_device *hdev) { - /* device_release() won't be called so must free devices explicitly */ - if (!hdev->cdev_sysfs_created) { - kfree(hdev->dev_ctrl); - kfree(hdev->dev); - return; - } + if (!hdev->cdev_sysfs_created) + goto put_devices; hl_sysfs_fini(hdev); cdev_device_del(&hdev->cdev_ctrl, hdev->dev_ctrl); cdev_device_del(&hdev->cdev, hdev->dev); + +put_devices: + put_device(hdev->dev); + put_device(hdev->dev_ctrl); } static void device_hard_reset_pending(struct work_struct *work) @@ -1430,9 +1430,9 @@ sw_fini: early_fini: device_early_fini(hdev); free_dev_ctrl: - kfree(hdev->dev_ctrl); + put_device(hdev->dev_ctrl); free_dev: - kfree(hdev->dev); + put_device(hdev->dev); out_disabled: hdev->disabled = true; if (add_cdev_sysfs_on_err) |