Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1291038

[PATCH] ath9k_htc: fix handling return value of ath9k_hw_calibrate

From Andrzej Hajda <a.hajda@samsung.com>
Newsgroups linux.kernel
Subject [PATCH] ath9k_htc: fix handling return value of ath9k_hw_calibrate
Date 2015-12-14 11:10 +0100
Message-ID <qFyeU-4Fp-31@gated-at.bofh.it> (permalink)
References <qFyeT-4Fp-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The function can return negative values in case of error.
Its result should be then tested for such case.

The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2046107

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
 drivers/net/wireless/ath/ath9k/htc_drv_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index a680a97..fe1fd1a 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -834,7 +834,7 @@ void ath9k_htc_ani_work(struct work_struct *work)
 		if (longcal || shortcal)
 			common->ani.caldone =
 				ath9k_hw_calibrate(ah, ah->curchan,
-						   ah->rxchainmask, longcal);
+						ah->rxchainmask, longcal) > 0;
 
 		ath9k_htc_ps_restore(priv);
 	}
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] net/mlx4_core: fix handling return value of  mlx4_slave_convert_port Andrzej Hajda <a.hajda@samsung.com> - 2015-12-14 11:10 +0100
  [PATCH] extcon: max14577: fix handling return value of  regmap_irq_get_virq Andrzej Hajda <a.hajda@samsung.com> - 2015-12-14 11:10 +0100
    Re: [PATCH] extcon: max14577: fix handling return value of regmap_irq_get_virq Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2015-12-14 11:40 +0100
      [PATCH] extcon: max77693: fix handling return value of  regmap_irq_get_virq Andrzej Hajda <a.hajda@samsung.com> - 2015-12-14 12:20 +0100
        Re: [PATCH] extcon: max77693: fix handling return value of  regmap_irq_get_virq Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2015-12-15 01:30 +0100
        Re: [PATCH] extcon: max77693: fix handling return value of  regmap_irq_get_virq Chanwoo Choi <cw00.choi@samsung.com> - 2015-12-15 02:10 +0100
    Re: [PATCH] extcon: max14577: fix handling return value of  regmap_irq_get_virq Chanwoo Choi <cw00.choi@samsung.com> - 2015-12-15 02:10 +0100
  [PATCH] clk: sunxi: fix handling return value of  of_property_match_string Andrzej Hajda <a.hajda@samsung.com> - 2015-12-14 11:10 +0100
    Re: [PATCH] clk: sunxi: fix handling return value of  of_property_match_string Maxime Ripard <maxime.ripard@free-electrons.com> - 2015-12-14 14:10 +0100
  [PATCH] doc: mei: fix handling return value of mei_recv_msg Andrzej Hajda <a.hajda@samsung.com> - 2015-12-14 11:10 +0100
    RE: [PATCH] doc: mei: fix handling return value of mei_recv_msg "Winkler, Tomas" <tomas.winkler@intel.com> - 2015-12-14 13:10 +0100
  [PATCH] ath9k_htc: fix handling return value of ath9k_hw_calibrate Andrzej Hajda <a.hajda@samsung.com> - 2015-12-14 11:10 +0100
    Re: [PATCH] ath9k_htc: fix handling return value of ath9k_hw_calibrate Kalle Valo <kvalo@codeaurora.org> - 2015-12-31 14:20 +0100
  [PATCH] be2iscsi: fix handling return value of mgmt_open_connection Andrzej Hajda <a.hajda@samsung.com> - 2015-12-14 11:10 +0100
  [PATCH] extcon: max77843: fix handling return value of  regmap_irq_get_virq Andrzej Hajda <a.hajda@samsung.com> - 2015-12-14 11:10 +0100
    Re: [PATCH] extcon: max77843: fix handling return value of regmap_irq_get_virq Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2015-12-14 11:40 +0100
    Re: [PATCH] extcon: max77843: fix handling return value of  regmap_irq_get_virq Chanwoo Choi <cw00.choi@samsung.com> - 2015-12-15 02:10 +0100
  Re: [PATCH] net/mlx4_core: fix handling return value of  mlx4_slave_convert_port David Miller <davem@davemloft.net> - 2015-12-15 18:00 +0100

csiph-web