linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dominique van den Broeck <domdevlin@free.fr>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org,
	Dominique van den Broeck <domdevlin@free.fr>
Subject: [PATCH 1/2] staging/rtl8192e: Erroneous return codes (types and values)
Date: Sun, 27 Apr 2014 19:11:15 +0200	[thread overview]
Message-ID: <1398618676-31095-1-git-send-email-domdevlin@free.fr> (raw)

This function returns a bool, that is supposed to be false when something
goes wrong. It's assumed this way by its lone calling function (which is
SetRFPowerState8190(), line 1445 of rtl8192e/rtl8192e/r8192E_phy.c)

Despite of this, this procedure returns non-null enumerations values or
negative codes instead. This patch fixes this.

Signed-off-by: Dominique van den Broeck <domdevlin@free.fr>
---
I submit this patch as a result for Task #16 of the Eudyptula Challenge.

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index c01abc2..a6f2b2b 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -3030,7 +3030,7 @@ bool NicIFEnableNIC(struct net_device *dev)
 		RT_TRACE(COMP_ERR, "ERR!!! %s(): Driver is already down!\n",
 			 __func__);
 		priv->bdisable_nic = false;
-		return RT_STATUS_FAILURE;
+		return false;
 	}
 
 	RT_TRACE(COMP_PS, "===========>%s()\n", __func__);
@@ -3040,7 +3040,7 @@ bool NicIFEnableNIC(struct net_device *dev)
 		RT_TRACE(COMP_ERR, "ERR!!! %s(): initialization is failed!\n",
 			 __func__);
 		priv->bdisable_nic = false;
-		return -1;
+		return false;
 	}
 	RT_TRACE(COMP_INIT, "start adapter finished\n");
 	RT_CLEAR_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC);

             reply	other threads:[~2014-04-27 17:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-27 17:11 Dominique van den Broeck [this message]
2014-04-27 17:11 ` [PATCH 2/2] staging/rtl8192e: userspace ptr deref + incorrect declarations Dominique van den Broeck
2014-04-27 17:47   ` Levente Kurusa
2014-04-27 18:05     ` Dominique van den Broeck
2014-05-04  0:22   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1398618676-31095-1-git-send-email-domdevlin@free.fr \
    --to=domdevlin@free.fr \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).