aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/can/janz-ican3.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/can/janz-ican3.c')
-rw-r--r--drivers/net/can/janz-ican3.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
index e24e6690d672..71594e5676fd 100644
--- a/drivers/net/can/janz-ican3.c
+++ b/drivers/net/can/janz-ican3.c
@@ -18,6 +18,7 @@
18#include <linux/netdevice.h> 18#include <linux/netdevice.h>
19#include <linux/can.h> 19#include <linux/can.h>
20#include <linux/can/dev.h> 20#include <linux/can/dev.h>
21#include <linux/can/skb.h>
21#include <linux/can/error.h> 22#include <linux/can/error.h>
22 23
23#include <linux/mfd/janz.h> 24#include <linux/mfd/janz.h>
@@ -1133,20 +1134,9 @@ static void ican3_handle_message(struct ican3_dev *mod, struct ican3_msg *msg)
1133 */ 1134 */
1134static void ican3_put_echo_skb(struct ican3_dev *mod, struct sk_buff *skb) 1135static void ican3_put_echo_skb(struct ican3_dev *mod, struct sk_buff *skb)
1135{ 1136{
1136 struct sock *srcsk = skb->sk; 1137 skb = can_create_echo_skb(skb);
1137 1138 if (!skb)
1138 if (atomic_read(&skb->users) != 1) { 1139 return;
1139 struct sk_buff *old_skb = skb;
1140
1141 skb = skb_clone(old_skb, GFP_ATOMIC);
1142 kfree_skb(old_skb);
1143 if (!skb)
1144 return;
1145 } else {
1146 skb_orphan(skb);
1147 }
1148
1149 skb->sk = srcsk;
1150 1140
1151 /* save this skb for tx interrupt echo handling */ 1141 /* save this skb for tx interrupt echo handling */
1152 skb_queue_tail(&mod->echoq, skb); 1142 skb_queue_tail(&mod->echoq, skb);
@@ -1322,7 +1312,7 @@ static int ican3_napi(struct napi_struct *napi, int budget)
1322 1312
1323 /* process all communication messages */ 1313 /* process all communication messages */
1324 while (true) { 1314 while (true) {
1325 struct ican3_msg msg; 1315 struct ican3_msg uninitialized_var(msg);
1326 ret = ican3_recv_msg(mod, &msg); 1316 ret = ican3_recv_msg(mod, &msg);
1327 if (ret) 1317 if (ret)
1328 break; 1318 break;