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

Commit 023a04be authored by Jeremy Fitzhardinge's avatar Jeremy Fitzhardinge Committed by John W. Linville
Browse files

mac80211: return correct error return from ieee80211_wep_init



Return the proper error code rather than a hard-coded ENOMEM from
ieee80211_wep_init.  Also, print the error code on failure.

Signed-off-by: default avatarJeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 1b024165
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1731,8 +1731,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
	result = ieee80211_wep_init(local);

	if (result < 0) {
		printk(KERN_DEBUG "%s: Failed to initialize wep\n",
		       wiphy_name(local->hw.wiphy));
		printk(KERN_DEBUG "%s: Failed to initialize wep: %d\n",
		       wiphy_name(local->hw.wiphy), result);
		goto fail_wep;
	}

+2 −2
Original line number Diff line number Diff line
@@ -31,13 +31,13 @@ int ieee80211_wep_init(struct ieee80211_local *local)
	local->wep_tx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0,
						CRYPTO_ALG_ASYNC);
	if (IS_ERR(local->wep_tx_tfm))
		return -ENOMEM;
		return PTR_ERR(local->wep_tx_tfm);

	local->wep_rx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0,
						CRYPTO_ALG_ASYNC);
	if (IS_ERR(local->wep_rx_tfm)) {
		crypto_free_blkcipher(local->wep_tx_tfm);
		return -ENOMEM;
		return PTR_ERR(local->wep_rx_tfm);
	}

	return 0;