File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -114,12 +114,16 @@ _rocm_smi_init_private(void)
114114
115115 int count = 0 ;
116116 papi_errno = evt_get_count (& count );
117+ if (papi_errno != PAPI_OK ) {
118+ goto fn_fail ;
119+ }
117120 _rocm_smi_vector .cmp_info .num_native_events = count ;
118121 _rocm_smi_vector .cmp_info .num_cntrs = count ;
119122 _rocm_smi_vector .cmp_info .num_mpx_cntrs = count ;
120123
121- fn_exit :
122124 _rocm_smi_vector .cmp_info .initialized = 1 ;
125+
126+ fn_exit :
123127 _rocm_smi_vector .cmp_info .disabled = papi_errno ;
124128 PAPI_unlock (COMPONENT_LOCK );
125129 return papi_errno ;
Original file line number Diff line number Diff line change @@ -222,12 +222,16 @@ rocp_sdk_init_private(void)
222222
223223 int count = 0 ;
224224 papi_errno = evt_get_count (& count );
225+ if (papi_errno != PAPI_OK ) {
226+ goto fn_fail ;
227+ }
225228 _rocp_sdk_vector .cmp_info .num_native_events = count ;
226229 _rocp_sdk_vector .cmp_info .num_cntrs = count ;
227230 _rocp_sdk_vector .cmp_info .num_mpx_cntrs = count ;
228231
229- fn_exit :
230232 _rocp_sdk_vector .cmp_info .initialized = 1 ;
233+
234+ fn_exit :
231235 _rocp_sdk_vector .cmp_info .disabled = papi_errno ;
232236 _papi_hwi_unlock (COMPONENT_LOCK );
233237 return papi_errno ;
Original file line number Diff line number Diff line change @@ -167,11 +167,15 @@ templ_init_private(void)
167167
168168 int count = 0 ;
169169 papi_errno = evt_get_count (& count );
170+ if (papi_errno != PAPI_OK ) {
171+ goto fn_fail ;
172+ }
170173 _template_vector .cmp_info .num_native_events = count ;
171174 _template_vector .cmp_info .num_cntrs = count ;
172175
173- fn_exit :
174176 _template_vector .cmp_info .initialized = 1 ;
177+
178+ fn_exit :
175179 _template_vector .cmp_info .disabled = papi_errno ;
176180 _papi_hwi_unlock (COMPONENT_LOCK );
177181 return papi_errno ;
You can’t perform that action at this time.
0 commit comments