Browse Source

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>
Kumar Amit Mehta 12 years ago
parent
commit
b53cf458ea
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/net/wireless/hostap/hostap_ap.c

+ 1 - 1
drivers/net/wireless/hostap/hostap_ap.c

@@ -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);