driver: rknpu: Fix missing misc_deregister() on dma heap open failure

Signed-off-by: Shuangjie Lin <shuangjie.lin@rock-chips.com>
Change-Id: I8e0f622cb5090b2eae0ac819b4bfb78e35ada261
This commit is contained in:
Shuangjie Lin
2025-04-27 16:00:33 +08:00
committed by Tao Huang
parent 63f6206c76
commit 7c86d0dc46

View File

@@ -1451,6 +1451,7 @@ static int rknpu_probe(struct platform_device *pdev)
rknpu_dev->heap = rk_dma_heap_find("rk-dma-heap-cma");
if (!rknpu_dev->heap) {
LOG_DEV_ERROR(dev, "failed to find cma heap\n");
misc_deregister(&rknpu_dev->miscdev);
return -ENOMEM;
}
rk_dma_heap_set_dev(dev);