If no firmware was found and the coda module is unloaded, coda_runtime_resume will be called without an allocated code buffer. Do not call coda_hw_init in this case. Signed-off-by: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx> --- drivers/media/platform/coda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/coda.c b/drivers/media/platform/coda.c index d5abb7c..10f9278 100644 --- a/drivers/media/platform/coda.c +++ b/drivers/media/platform/coda.c @@ -3904,7 +3904,7 @@ static int coda_runtime_resume(struct device *dev) struct coda_dev *cdev = dev_get_drvdata(dev); int ret = 0; - if (dev->pm_domain) { + if (dev->pm_domain && cdev->codebuf.vaddr) { ret = coda_hw_init(cdev); if (ret) v4l2_err(&cdev->v4l2_dev, "HW initialization failed\n"); -- 2.0.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html