hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/nfc/s3fwrn5/core.c
....@@ -1,20 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * NCI based driver for Samsung S3FWRN5 NFC chip
34 *
45 * Copyright (C) 2015 Samsung Electrnoics
56 * Robert Baldyga <r.baldyga@samsung.com>
6
- *
7
- * This program is free software; you can redistribute it and/or modify it
8
- * under the terms and conditions of the GNU General Public License,
9
- * version 2 or later, as published by the Free Software Foundation.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
187 */
198
209 #include <linux/module.h>
....@@ -108,11 +97,15 @@
10897 }
10998
11099 ret = s3fwrn5_write(info, skb);
111
- if (ret < 0)
100
+ if (ret < 0) {
112101 kfree_skb(skb);
102
+ mutex_unlock(&info->mutex);
103
+ return ret;
104
+ }
113105
106
+ consume_skb(skb);
114107 mutex_unlock(&info->mutex);
115
- return ret;
108
+ return 0;
116109 }
117110
118111 static int s3fwrn5_nci_post_setup(struct nci_dev *ndev)