public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreea-Cristina Bernat <bernat.ada@gmail.com>
To: gregkh@linuxfoundation.org, Larry.Finger@lwfinger.net,
	oat.elena@gmail.com, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Cc: paulmck@linux.vnet.ibm.com
Subject: [PATCH] rtl8188eu: Replace rcu_dereference() with rcu_access_pointer()
Date: Sun, 17 Aug 2014 14:43:37 +0300	[thread overview]
Message-ID: <20140817114336.GA24984@ada> (raw)

The "rcu_dereference()" call is used directly in a condition.
Since its return value is never dereferenced it is recommended to use
"rcu_access_pointer()" instead of "rcu_dereference()".
Therefore, this patch makes the replacement.

The following Coccinelle semantic patch was used:
@@
@@

(
 if(
 (<+...
- rcu_dereference
+ rcu_access_pointer
  (...)
  ...+>)) {...}
|
 while(
 (<+...
- rcu_dereference
+ rcu_access_pointer
  (...)
  ...+>)) {...}
)

Signed-off-by: Andreea-Cristina Bernat <bernat.ada@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_mlme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c
index 155282e..8643003 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c
@@ -1544,7 +1544,7 @@ void rtw_dynamic_check_timer_handlder(struct adapter *adapter)
 
 	rcu_read_lock();
 
-	if (rcu_dereference(adapter->pnetdev->rx_handler_data) &&
+	if (rcu_access_pointer(adapter->pnetdev->rx_handler_data) &&
 	    (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true)) {
 		/*  expire NAT2.5 entry */
 		nat25_db_expire(adapter);
-- 
1.9.1


             reply	other threads:[~2014-08-17 11:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-17 11:43 Andreea-Cristina Bernat [this message]
2014-08-30 20:42 ` [PATCH] rtl8188eu: Replace rcu_dereference() with rcu_access_pointer() Greg KH
2014-09-04 20:58   ` Andreea Bernat
2014-09-04 21:23     ` Larry Finger
2014-09-04 21:38     ` Greg KH
2014-09-05 18:21       ` Andreea Bernat

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=20140817114336.GA24984@ada \
    --to=bernat.ada@gmail.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oat.elena@gmail.com \
    --cc=paulmck@linux.vnet.ibm.com \
    /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