net: wireless: hostap: hostap_ap.c: Return -ENOMEM instead of -1 for if kmalloc(...
authorKumar Amit Mehta <gmate.amit@gmail.com>
Mon, 18 Feb 2013 12:13:44 +0000 (04:13 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 18 Feb 2013 20:30:40 +0000 (15:30 -0500)
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>
drivers/net/wireless/hostap/hostap_ap.c

index c6ea995750db80c9664351c079be86be81c70262..dd9a18f8dbcae411bfda2bedb6f762afd2010185 100644 (file)
@@ -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);