Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b026f6e8 authored by Chaehyun Lim's avatar Chaehyun Lim Committed by Greg Kroah-Hartman
Browse files

staging: wilc1000: linux_mon: fix error code of kmalloc



This patch fixes error codes as -ENOMEM instead of using -EFAULT if
kmalloc is failed.

Signed-off-by: default avatarChaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fa611271
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -166,14 +166,14 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len)
	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;