All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] NFC fixes for 3.5
@ 2012-07-06 22:53 Samuel Ortiz
  2012-07-06 22:53 ` [PATCH 1/2] NFC: Fix empty HCI message list check Samuel Ortiz
  2012-07-06 22:53 ` [PATCH 2/2] NFC: Fix order of arguments to list_add_tail() when queueing HCP frames Samuel Ortiz
  0 siblings, 2 replies; 3+ messages in thread
From: Samuel Ortiz @ 2012-07-06 22:53 UTC (permalink / raw)
  To: John W. Linville
  Cc: Lauro Ramos Venancio, Aloisio Almeida Jr, Ilan Elias,
	linux-wireless, linux-nfc, Samuel Ortiz

Hi John,

I have a couple of HCI fixes from Mathias, for 3.5. Thanks in advance for
pulling them in.

You can pull them from:

git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-3.0.git tags/nfc-fixes-3.5-2


Mathias Jeppsson (2):
  NFC: Fix empty HCI message list check
  NFC: Fix order of arguments to list_add_tail() when queueing HCP
    frames

 net/nfc/hci/core.c |    5 ++---
 net/nfc/hci/hcp.c  |    2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

-- 
1.7.10


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] NFC: Fix empty HCI message list check
  2012-07-06 22:53 [PATCH 0/2] NFC fixes for 3.5 Samuel Ortiz
@ 2012-07-06 22:53 ` Samuel Ortiz
  2012-07-06 22:53 ` [PATCH 2/2] NFC: Fix order of arguments to list_add_tail() when queueing HCP frames Samuel Ortiz
  1 sibling, 0 replies; 3+ messages in thread
From: Samuel Ortiz @ 2012-07-06 22:53 UTC (permalink / raw)
  To: John W. Linville
  Cc: Lauro Ramos Venancio, Aloisio Almeida Jr, Ilan Elias,
	linux-wireless, linux-nfc, Mathias Jeppsson, Samuel Ortiz

From: Mathias Jeppsson <mathias.jeppsson@sonymobile.com>

list_first_entry() will never return NULL. Instead use
list_for_each_entry_safe() to iterate through the list.

Signed-off-by: Mathias Jeppsson <mathias.jeppsson@sonymobile.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 net/nfc/hci/core.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c
index e1a640d..da6e039 100644
--- a/net/nfc/hci/core.c
+++ b/net/nfc/hci/core.c
@@ -682,13 +682,12 @@ EXPORT_SYMBOL(nfc_hci_register_device);
 
 void nfc_hci_unregister_device(struct nfc_hci_dev *hdev)
 {
-	struct hci_msg *msg;
+	struct hci_msg *msg, *n;
 
 	skb_queue_purge(&hdev->rx_hcp_frags);
 	skb_queue_purge(&hdev->msg_rx_queue);
 
-	while ((msg = list_first_entry(&hdev->msg_tx_queue, struct hci_msg,
-				       msg_l)) != NULL) {
+	list_for_each_entry_safe(msg, n, &hdev->msg_tx_queue, msg_l) {
 		list_del(&msg->msg_l);
 		skb_queue_purge(&msg->msg_frags);
 		kfree(msg);
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] NFC: Fix order of arguments to list_add_tail() when queueing HCP frames
  2012-07-06 22:53 [PATCH 0/2] NFC fixes for 3.5 Samuel Ortiz
  2012-07-06 22:53 ` [PATCH 1/2] NFC: Fix empty HCI message list check Samuel Ortiz
@ 2012-07-06 22:53 ` Samuel Ortiz
  1 sibling, 0 replies; 3+ messages in thread
From: Samuel Ortiz @ 2012-07-06 22:53 UTC (permalink / raw)
  To: John W. Linville
  Cc: Lauro Ramos Venancio, Aloisio Almeida Jr, Ilan Elias,
	linux-wireless, linux-nfc, Mathias Jeppsson, Samuel Ortiz

From: Mathias Jeppsson <mathias.jeppsson@sonymobile.com>

The HCP message should be added to transmit queue, not the other way around.

Signed-off-by: Mathias Jeppsson <mathias.jeppsson@sonymobile.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 net/nfc/hci/hcp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/nfc/hci/hcp.c b/net/nfc/hci/hcp.c
index 7212cf2..f4dad1a 100644
--- a/net/nfc/hci/hcp.c
+++ b/net/nfc/hci/hcp.c
@@ -105,7 +105,7 @@ int nfc_hci_hcp_message_tx(struct nfc_hci_dev *hdev, u8 pipe,
 	}
 
 	mutex_lock(&hdev->msg_tx_mutex);
-	list_add_tail(&hdev->msg_tx_queue, &cmd->msg_l);
+	list_add_tail(&cmd->msg_l, &hdev->msg_tx_queue);
 	mutex_unlock(&hdev->msg_tx_mutex);
 
 	queue_work(hdev->msg_tx_wq, &hdev->msg_tx_work);
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-07-06 22:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-06 22:53 [PATCH 0/2] NFC fixes for 3.5 Samuel Ortiz
2012-07-06 22:53 ` [PATCH 1/2] NFC: Fix empty HCI message list check Samuel Ortiz
2012-07-06 22:53 ` [PATCH 2/2] NFC: Fix order of arguments to list_add_tail() when queueing HCP frames Samuel Ortiz

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.