hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/net/nfc/nci/data.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * The NFC Controller Interface is the communication protocol between an
34 * NFC Controller (NFCC) and a Device Host (DH).
....@@ -6,19 +7,6 @@
67 * Copyright (C) 2014 Marvell International Ltd.
78 *
89 * Written by Ilan Elias <ilane@ti.com>
9
- *
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License version 2
12
- * as published by the Free Software Foundation
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU General Public License
20
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
21
- *
2210 */
2311
2412 #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__
....@@ -130,7 +118,7 @@
130118
131119 skb_frag = nci_skb_alloc(ndev,
132120 (NCI_DATA_HDR_SIZE + frag_len),
133
- GFP_KERNEL);
121
+ GFP_ATOMIC);
134122 if (skb_frag == NULL) {
135123 rc = -ENOMEM;
136124 goto free_exit;
....@@ -291,8 +279,10 @@
291279 nci_plen(skb->data));
292280
293281 conn_info = nci_get_conn_info_by_conn_id(ndev, nci_conn_id(skb->data));
294
- if (!conn_info)
282
+ if (!conn_info) {
283
+ kfree_skb(skb);
295284 return;
285
+ }
296286
297287 /* strip the nci data header */
298288 skb_pull(skb, NCI_DATA_HDR_SIZE);