c
bool frag_used = false;
...
if (fragid == FIRST_FRAGMENT) {
    if (unlikely(head))
        goto err;
    if (skb_has_frag_list(frag) && __skb_linearize(frag))
        goto err;
    frag = skb_unshare(frag, GFP_ATOMIC);
    if (unlikely(!frag))
        goto err;
    head = *headbuf = frag;
    TIPC_SKB_CB(head)->tail = NULL;
    frag_used = true;
    *buf = NULL;
    return 0;
}
...
if (frag_used) {
    // Do not use frag after this point
}
