Skip to content
Permalink
Browse files

drivers: modem: wncm14a2a: dont free packet on error

Caller will handle freeing packet if error is encountered.

Fixes issue reported by Github User @weinholtendian:
<err> net_pkt: *** ERROR *** pkt 0x20027e78 is freed already
by offload_sendto():1717 (context_sendto():1473).

Signed-off-by: Michael Scott <mike@foundries.io>
  • Loading branch information...
mike-scott authored and nashif committed May 17, 2019
1 parent fb0faaa commit d8f8f0f253522b317069e912006bb0008d006b69
Showing with 2 additions and 1 deletion.
  1. +2 −1 drivers/modem/wncm14a2a.c
@@ -1680,9 +1680,10 @@ static int offload_sendto(struct net_pkt *pkt,
ret = send_data(sock, pkt);
if (ret < 0) {
LOG_ERR("send_data error: %d", ret);
} else {
net_pkt_unref(pkt);
}

net_pkt_unref(pkt);
if (cb) {
cb(context, ret, user_data);
}

0 comments on commit d8f8f0f

Please sign in to comment.
You can’t perform that action at this time.