Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
net: wireless: hostap: hostap_ap.c: Return -ENOMEM instead of -1 for …
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
KumarAmitMehta authored and linvjw committed Feb 18, 2013
1 parent 488ec87 commit b53cf45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/hostap/hostap_ap.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ int ap_control_add_mac(struct mac_restrictions *mac_restrictions, u8 *mac)

entry = kmalloc(sizeof(struct mac_entry), GFP_KERNEL);
if (entry == NULL)
return -1;
return -ENOMEM;

memcpy(entry->addr, mac, ETH_ALEN);

Expand Down

0 comments on commit b53cf45

Please sign in to comment.