All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] net: nci: hci: Add check on skb nci_hci_send_cmd parameter
       [not found] <1440012403-15963-1-git-send-email-christophe-h.ricard@st.com>
@ 2015-08-19 19:26 ` Christophe Ricard
  0 siblings, 0 replies; only message in thread
From: Christophe Ricard @ 2015-08-19 19:26 UTC (permalink / raw)
  To: sameo; +Cc: linux-nfc, christophe-h.ricard, christophe.ricard, stable

skb can be NULL and may lead to a NULL pointer error.

Add a check condition before setting HCI rx buffer.

Cc: stable@vger.kernel.org
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
---
 net/nfc/nci/hci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/nfc/nci/hci.c b/net/nfc/nci/hci.c
index af002df..609f922 100644
--- a/net/nfc/nci/hci.c
+++ b/net/nfc/nci/hci.c
@@ -233,7 +233,7 @@ int nci_hci_send_cmd(struct nci_dev *ndev, u8 gate, u8 cmd,
 	r = nci_request(ndev, nci_hci_send_data_req, (unsigned long)&data,
 			msecs_to_jiffies(NCI_DATA_TIMEOUT));
 
-	if (r == NCI_STATUS_OK)
+	if (r == NCI_STATUS_OK && skb)
 		*skb = conn_info->rx_skb;
 
 	return r;
-- 
2.1.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-08-19 19:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1440012403-15963-1-git-send-email-christophe-h.ricard@st.com>
2015-08-19 19:26 ` [PATCH 1/2] net: nci: hci: Add check on skb nci_hci_send_cmd parameter Christophe Ricard

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.