Skip to content

Commit

Permalink
nfc: nci: hci: Add check on skb nci_hci_send_cmd parameter
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Christophe Ricard authored and Samuel Ortiz committed Aug 20, 2015
1 parent c04c674 commit 5a9e0ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/nfc/nci/hci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5a9e0ff

Please sign in to comment.