| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * The NFC Controller Interface is the communication protocol between an |
|---|
| 3 | 4 | * NFC Controller (NFCC) and a Device Host (DH). |
|---|
| .. | .. |
|---|
| 6 | 7 | * Copyright (C) 2014 Marvell International Ltd. |
|---|
| 7 | 8 | * |
|---|
| 8 | 9 | * 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 | | - * |
|---|
| 22 | 10 | */ |
|---|
| 23 | 11 | |
|---|
| 24 | 12 | #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__ |
|---|
| .. | .. |
|---|
| 130 | 118 | |
|---|
| 131 | 119 | skb_frag = nci_skb_alloc(ndev, |
|---|
| 132 | 120 | (NCI_DATA_HDR_SIZE + frag_len), |
|---|
| 133 | | - GFP_KERNEL); |
|---|
| 121 | + GFP_ATOMIC); |
|---|
| 134 | 122 | if (skb_frag == NULL) { |
|---|
| 135 | 123 | rc = -ENOMEM; |
|---|
| 136 | 124 | goto free_exit; |
|---|
| .. | .. |
|---|
| 291 | 279 | nci_plen(skb->data)); |
|---|
| 292 | 280 | |
|---|
| 293 | 281 | 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); |
|---|
| 295 | 284 | return; |
|---|
| 285 | + } |
|---|
| 296 | 286 | |
|---|
| 297 | 287 | /* strip the nci data header */ |
|---|
| 298 | 288 | skb_pull(skb, NCI_DATA_HDR_SIZE); |
|---|