From: Kumar Amit Mehta Date: Mon, 18 Feb 2013 12:13:44 +0000 (-0800) Subject: net: wireless: hostap: hostap_ap.c: Return -ENOMEM instead of -1 for if kmalloc(... X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b53cf458ea20dd7f5e32611366f63728e40c9021;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c index c6ea995750db..dd9a18f8dbca 100644 --- a/drivers/net/wireless/hostap/hostap_ap.c +++ b/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);