EAP peer: Simplify EAP method registration call
Free the allocated structure in error cases to remove need for each EAP method to handle the error cases separately. Each registration function can simply do "return eap_peer_method_register(eap);" in the end of the function. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
7ce5603251
commit
49a26bb3e3
23 changed files with 36 additions and 127 deletions
|
@ -83,7 +83,6 @@ static struct wpabuf * eap_otp_process(struct eap_sm *sm, void *priv,
|
|||
int eap_peer_otp_register(void)
|
||||
{
|
||||
struct eap_method *eap;
|
||||
int ret;
|
||||
|
||||
eap = eap_peer_method_alloc(EAP_PEER_METHOD_INTERFACE_VERSION,
|
||||
EAP_VENDOR_IETF, EAP_TYPE_OTP, "OTP");
|
||||
|
@ -94,8 +93,5 @@ int eap_peer_otp_register(void)
|
|||
eap->deinit = eap_otp_deinit;
|
||||
eap->process = eap_otp_process;
|
||||
|
||||
ret = eap_peer_method_register(eap);
|
||||
if (ret)
|
||||
eap_peer_method_free(eap);
|
||||
return ret;
|
||||
return eap_peer_method_register(eap);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue