Skip to content

Commit 32388d6

Browse files
Sakari Ailusmchehab
Sakari Ailus
authored andcommitted
media: ipu3-cio2: Unregister device nodes first, then release resources
While there are issues related to object lifetime management, unregister the media device first, followed immediately by other device nodes when the driver is being unbound. Only then the resources needed by the driver may be released. This is slightly safer. Signed-off-by: Sakari Ailus <[email protected]> Tested-by: Bingbu Cao <[email protected]> Reviewed-by: Bingbu Cao <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 30efae3 commit 32388d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/media/pci/intel/ipu3/ipu3-cio2.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1846,12 +1846,12 @@ static void cio2_pci_remove(struct pci_dev *pci_dev)
18461846
struct cio2_device *cio2 = pci_get_drvdata(pci_dev);
18471847
unsigned int i;
18481848

1849+
media_device_unregister(&cio2->media_dev);
18491850
cio2_notifier_exit(cio2);
1850-
cio2_fbpt_exit_dummy(cio2);
18511851
for (i = 0; i < CIO2_QUEUES; i++)
18521852
cio2_queue_exit(cio2, &cio2->queue[i]);
1853+
cio2_fbpt_exit_dummy(cio2);
18531854
v4l2_device_unregister(&cio2->v4l2_dev);
1854-
media_device_unregister(&cio2->media_dev);
18551855
media_device_cleanup(&cio2->media_dev);
18561856
mutex_destroy(&cio2->lock);
18571857
}

0 commit comments

Comments
 (0)