All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabian Frederick <fabf@skynet.be>
To: linux-kernel@vger.kernel.org
Cc: davem@davemloft.net, Peter Zijlstra <peterz@infradead.org>,
	Fabian Frederick <fabf@skynet.be>,
	netdev@vger.kernel.org
Subject: [PATCH 1/1 net-next] net/atm/signaling.c: replace current->state by  __set_current_state()
Date: Mon, 23 Feb 2015 18:31:07 +0100	[thread overview]
Message-ID: <1424712667-11849-1-git-send-email-fabf@skynet.be> (raw)

Use helper functions to access current->state.
Direct assignments are prone to races and therefore buggy.

Thanks to Peter Zijlstra for the exact definition of the problem.

Suggested-By: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 net/atm/signaling.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/atm/signaling.c b/net/atm/signaling.c
index 523bce7..0140832 100644
--- a/net/atm/signaling.c
+++ b/net/atm/signaling.c
@@ -40,7 +40,7 @@ static void sigd_put_skb(struct sk_buff *skb)
 		pr_debug("atmsvc: waiting for signaling daemon...\n");
 		schedule();
 	}
-	current->state = TASK_RUNNING;
+	__set_current_state(TASK_RUNNING);
 	remove_wait_queue(&sigd_sleep, &wait);
 #else
 	if (!sigd) {
-- 
2.1.0


             reply	other threads:[~2015-02-23 17:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-23 17:31 Fabian Frederick [this message]
2015-02-23 17:50 ` [PATCH 1/1 net-next] net/atm/signaling.c: replace current->state by __set_current_state() chas williams - CONTRACTOR
2015-02-23 22:20   ` David Miller

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=1424712667-11849-1-git-send-email-fabf@skynet.be \
    --to=fabf@skynet.be \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.