Skip to content

Commit 1b16cde

Browse files
cricard13gregkh
authored andcommitted
nfc: nci: hci: Add check on skb nci_hci_send_cmd parameter
commit 5a9e0ff upstream. skb can be NULL and may lead to a NULL pointer error. Add a check condition before setting HCI rx buffer. Signed-off-by: Christophe Ricard <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9c77c84 commit 1b16cde

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/nfc/nci/hci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ int nci_hci_send_cmd(struct nci_dev *ndev, u8 gate, u8 cmd,
233233
r = nci_request(ndev, nci_hci_send_data_req, (unsigned long)&data,
234234
msecs_to_jiffies(NCI_DATA_TIMEOUT));
235235

236-
if (r == NCI_STATUS_OK)
236+
if (r == NCI_STATUS_OK && skb)
237237
*skb = conn_info->rx_skb;
238238

239239
return r;

0 commit comments

Comments
 (0)