This patch fixes error codes as -ENOMEM instead of using -EFAULT if
kmalloc is failed.
Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mgmt_tx = kmalloc(sizeof(*mgmt_tx), GFP_ATOMIC);
if (!mgmt_tx) {
PRINT_ER("Failed to allocate memory for mgmt_tx structure\n");
- return -EFAULT;
+ return -ENOMEM;
}
mgmt_tx->buff = kmalloc(len, GFP_ATOMIC);
if (!mgmt_tx->buff) {
PRINT_ER("Failed to allocate memory for mgmt_tx buff\n");
kfree(mgmt_tx);
- return -EFAULT;
+ return -ENOMEM;
}
mgmt_tx->size = len;