if (pu8keybuf == NULL) {
PRINT_ER("No buffer to send Key\n");
- return -1;
+ return -ENOMEM;
}
kfree(pstrHostIFkeyAttr->attr.wep.key);
pu8keybuf = kmalloc(pstrHostIFkeyAttr->attr.wep.key_len + 2, GFP_KERNEL);
if (!pu8keybuf) {
PRINT_ER("No buffer to send Key\n");
- return -1;
+ return -ENOMEM;
}
pu8keybuf[0] = pstrHostIFkeyAttr->attr.wep.index;
memcpy(pu8keybuf + 1, &pstrHostIFkeyAttr->attr.wep.key_len, 1);
pu8keybuf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL);
if (!pu8keybuf) {
PRINT_ER("No buffer to send RxGTK Key\n");
- ret = -1;
+ ret = -ENOMEM;
goto _WPARxGtk_end_case_;
}
pu8keybuf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL);
if (pu8keybuf == NULL) {
PRINT_ER("No buffer to send RxGTK Key\n");
- ret = -1;
+ ret = -ENOMEM;
goto _WPARxGtk_end_case_;
}
_WPARxGtk_end_case_:
kfree(pstrHostIFkeyAttr->attr.wpa.key);
kfree(pstrHostIFkeyAttr->attr.wpa.seq);
- if (ret == -1)
+ if (ret)
return ret;
break;
pu8keybuf = kmalloc(PTK_KEY_MSG_LEN + 1, GFP_KERNEL);
if (!pu8keybuf) {
PRINT_ER("No buffer to send PTK Key\n");
- ret = -1;
+ ret = -ENOMEM;
goto _WPAPtk_end_case_;
}
pu8keybuf = kmalloc(PTK_KEY_MSG_LEN, GFP_KERNEL);
if (!pu8keybuf) {
PRINT_ER("No buffer to send PTK Key\n");
- ret = -1;
+ ret = -ENOMEM;
goto _WPAPtk_end_case_;
}
_WPAPtk_end_case_:
kfree(pstrHostIFkeyAttr->attr.wpa.key);
- if (ret == -1)
+ if (ret)
return ret;
break;
pu8keybuf = kmalloc((pstrHostIFkeyAttr->attr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1, GFP_KERNEL);
if (!pu8keybuf) {
PRINT_ER("No buffer to send PMKSA Key\n");
- return -1;
+ return -ENOMEM;
}
pu8keybuf[0] = pstrHostIFkeyAttr->attr.pmkid.numpmkid;