net: wireless: hostap: hostap_ap.c: Return -ENOMEM instead of -1 for if kmalloc() fails.
When memory allocation using, kmalloc() fails, report appropriate error value. Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
488ec87803
commit
b53cf458ea
|
@ -376,7 +376,7 @@ int ap_control_add_mac(struct mac_restrictions *mac_restrictions, u8 *mac)
|
||||||
|
|
||||||
entry = kmalloc(sizeof(struct mac_entry), GFP_KERNEL);
|
entry = kmalloc(sizeof(struct mac_entry), GFP_KERNEL);
|
||||||
if (entry == NULL)
|
if (entry == NULL)
|
||||||
return -1;
|
return -ENOMEM;
|
||||||
|
|
||||||
memcpy(entry->addr, mac, ETH_ALEN);
|
memcpy(entry->addr, mac, ETH_ALEN);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue