Fix NULL deref in kcf_remove_mech_provider
In the default case the function must return to avoid dereferencing 'prov_mech' which will be NULL. Reviewed-by: Tom Caputi <tcaputi@datto.com> Reviewed-by: Richard Laager <rlaager@wiktel.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: candychencan <chen.can2@zte.com.cn> Closes #5134
This commit is contained in:
parent
0a8f18f932
commit
0ca5261be4
@ -659,7 +659,9 @@ kcf_remove_mech_provider(char *mech_name, kcf_provider_desc_t *prov_desc)
|
||||
mech_entry->me_sw_prov = NULL;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
/* unexpected crypto_provider_type_t */
|
||||
mutex_exit(&mech_entry->me_mutex);
|
||||
return;
|
||||
}
|
||||
|
||||
mutex_exit(&mech_entry->me_mutex);
|
||||
|
Loading…
Reference in New Issue
Block a user