@@ -1829,6 +1829,10 @@ static int etm_probe(struct amba_device *adev, const struct amba_id *id)
return ret;
drvdata->cpu = pdata ? pdata->cpu : 0;
+ if (drvdata->cpu < 0) {
+ ret = -EINVAL;
+ goto err_arch_supported;
+ }
get_online_cpus();
etmdrvdata[drvdata->cpu] = drvdata;
@@ -196,8 +196,7 @@ struct coresight_platform_data *of_get_coresight_platform_data(
if (cell) {
hwid = of_read_number(cell, of_n_addr_cells(dn));
index = get_logical_index(hwid);
- if (index != -EINVAL)
- pdata->cpu = index;
+ pdata->cpu = index;
}
}