Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1366457 > unrolled thread
| Started by | Colin King <colin.king@canonical.com> |
|---|---|
| First post | 2016-03-29 18:50 +0200 |
| Last post | 2016-03-29 18:50 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] rtl8xxxu: fix uninitialized return value in ret Colin King <colin.king@canonical.com> - 2016-03-29 18:50 +0200
Re: [PATCH] rtl8xxxu: fix uninitialized return value in ret Jes Sorensen <Jes.Sorensen@redhat.com> - 2016-03-29 18:50 +0200
| From | Colin King <colin.king@canonical.com> |
|---|---|
| Date | 2016-03-29 18:50 +0200 |
| Subject | [PATCH] rtl8xxxu: fix uninitialized return value in ret |
| Message-ID | <ri506-wp-1@gated-at.bofh.it> |
From: Colin Ian King <colin.king@canonical.com>
several functions are not initializing a return status in ret
resulting in garbage to be returned instead of 0 for success.
Currently, the calls to these functions are not checking the
return, however, it seems prudent to return the correct status
in case they are to be checked at a later date.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index abdff45..9262aad 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -5231,7 +5231,7 @@ static void rtl8xxxu_set_ampdu_min_space(struct rtl8xxxu_priv *priv, u8 density)
static int rtl8xxxu_active_to_emu(struct rtl8xxxu_priv *priv)
{
u8 val8;
- int count, ret;
+ int count, ret = 0;
/* Start of rtl8723AU_card_enable_flow */
/* Act to Cardemu sequence*/
@@ -5281,7 +5281,7 @@ static int rtl8723bu_active_to_emu(struct rtl8xxxu_priv *priv)
u8 val8;
u16 val16;
u32 val32;
- int count, ret;
+ int count, ret = 0;
/* Turn off RF */
rtl8xxxu_write8(priv, REG_RF_CTRL, 0);
@@ -5338,7 +5338,7 @@ static int rtl8xxxu_active_to_lps(struct rtl8xxxu_priv *priv)
{
u8 val8;
u8 val32;
- int count, ret;
+ int count, ret = 0;
rtl8xxxu_write8(priv, REG_TXPAUSE, 0xff);
--
2.7.4
[toc] | [next] | [standalone]
| From | Jes Sorensen <Jes.Sorensen@redhat.com> |
|---|---|
| Date | 2016-03-29 18:50 +0200 |
| Message-ID | <ri507-wp-21@gated-at.bofh.it> |
| In reply to | #1366457 |
Colin King <colin.king@canonical.com> writes:
> From: Colin Ian King <colin.king@canonical.com>
>
> several functions are not initializing a return status in ret
> resulting in garbage to be returned instead of 0 for success.
> Currently, the calls to these functions are not checking the
> return, however, it seems prudent to return the correct status
> in case they are to be checked at a later date.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Thanks for the patch! I'm surprised the compiler didn't warn about this.
I'll add it to my queue for rtl8xxxu.
Cheers,
Jes
>
> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
> index abdff45..9262aad 100644
> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
> @@ -5231,7 +5231,7 @@ static void rtl8xxxu_set_ampdu_min_space(struct rtl8xxxu_priv *priv, u8 density)
> static int rtl8xxxu_active_to_emu(struct rtl8xxxu_priv *priv)
> {
> u8 val8;
> - int count, ret;
> + int count, ret = 0;
>
> /* Start of rtl8723AU_card_enable_flow */
> /* Act to Cardemu sequence*/
> @@ -5281,7 +5281,7 @@ static int rtl8723bu_active_to_emu(struct rtl8xxxu_priv *priv)
> u8 val8;
> u16 val16;
> u32 val32;
> - int count, ret;
> + int count, ret = 0;
>
> /* Turn off RF */
> rtl8xxxu_write8(priv, REG_RF_CTRL, 0);
> @@ -5338,7 +5338,7 @@ static int rtl8xxxu_active_to_lps(struct rtl8xxxu_priv *priv)
> {
> u8 val8;
> u8 val32;
> - int count, ret;
> + int count, ret = 0;
>
> rtl8xxxu_write8(priv, REG_TXPAUSE, 0xff);
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web