Message ID | 20210716191733.2976039-1-trix@redhat.com |
---|---|
State | Accepted |
Commit | fa0b5658597f1362c08c662a3a3c5139829e13a8 |
Headers | show |
Series | media: ti-vpe: cal: fix indexing of cal->ctx[] in cal_probe() | expand |
diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c index 05bdc6d126d82..8e469d518a742 100644 --- a/drivers/media/platform/ti-vpe/cal.c +++ b/drivers/media/platform/ti-vpe/cal.c @@ -1148,9 +1148,9 @@ static int cal_probe(struct platform_device *pdev) if (!cal->phy[i]->source_node) continue; - cal->ctx[i] = cal_ctx_create(cal, i); - if (!cal->ctx[i]) { - cal_err(cal, "Failed to create context %u\n", i); + cal->ctx[cal->num_contexts] = cal_ctx_create(cal, i); + if (!cal->ctx[cal->num_contexts]) { + cal_err(cal, "Failed to create context %u\n", cal->num_contexts); ret = -ENODEV; goto error_context; }