mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
coresight: Fix uninitialised variable use in coresight_disable
Kernel test robot reports: drivers/hwtracing/coresight/coresight-core.c:1176:7: warning: variable 'hash' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized] case CORESIGHT_DEV_SUBTYPE_SOURCE_PROC: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/hwtracing/coresight/coresight-core.c:1195:24: note: uninitialized use occurs here idr_remove(&path_idr, hash); ^~~~ Fix this by moving the usage of the hash variable to where it actually should have been. Cc: Mao Jinlong <quic_jinlmao@quicinc.com> Link: https://lkml.kernel.org/r/202301211339.9mU0dccO-lkp@intel.com Reported-by: kernel test robot <lkp@intel.com> Reviewed-by: James Clark <james.clark@arm.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Link: https://lkml.kernel.org/r/20230123164700.1074064-1-suzuki.poulose@arm.com
This commit is contained in:
parent
705159622c
commit
0c507af711
1 changed files with 1 additions and 1 deletions
|
@ -1189,13 +1189,13 @@ void coresight_disable(struct coresight_device *csdev)
|
||||||
pr_err("Path is not found for %s\n", dev_name(&csdev->dev));
|
pr_err("Path is not found for %s\n", dev_name(&csdev->dev));
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
idr_remove(&path_idr, hash);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* We can't be here */
|
/* We can't be here */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
idr_remove(&path_idr, hash);
|
|
||||||
coresight_disable_path(path);
|
coresight_disable_path(path);
|
||||||
coresight_release_path(path);
|
coresight_release_path(path);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue