struct tc_mqprio_qopt_offload {
        /* struct tc_mqprio_qopt must always be the first element */
        struct tc_mqprio_qopt qopt;
+       struct netlink_ext_ack *extack;
        u16 mode;
        u16 shaper;
        u32 flags;
 
 struct tc_taprio_qopt_offload {
        struct tc_mqprio_qopt_offload mqprio;
+       struct netlink_ext_ack *extack;
        u8 enable;
        ktime_t base_time;
        u64 cycle_time;
 
                                 const struct tc_mqprio_qopt *qopt,
                                 struct netlink_ext_ack *extack)
 {
-       struct tc_mqprio_qopt_offload mqprio = {.qopt = *qopt};
        struct mqprio_sched *priv = qdisc_priv(sch);
        struct net_device *dev = qdisc_dev(sch);
+       struct tc_mqprio_qopt_offload mqprio = {
+               .qopt = *qopt,
+               .extack = extack,
+       };
        int err, i;
 
        switch (priv->mode) {
 
                return -ENOMEM;
        }
        offload->enable = 1;
+       offload->extack = extack;
        mqprio_qopt_reconstruct(dev, &offload->mqprio.qopt);
+       offload->mqprio.extack = extack;
        taprio_sched_to_offload(dev, sched, offload, &caps);
 
        for (tc = 0; tc < TC_MAX_QUEUE; tc++)
 
        err = ops->ndo_setup_tc(dev, TC_SETUP_QDISC_TAPRIO, offload);
        if (err < 0) {
-               NL_SET_ERR_MSG(extack,
-                              "Device failed to setup taprio offload");
+               NL_SET_ERR_MSG_WEAK(extack,
+                                   "Device failed to setup taprio offload");
                goto done;
        }
 
        q->offloaded = true;
 
 done:
+       /* The offload structure may linger around via a reference taken by the
+        * device driver, so clear up the netlink extack pointer so that the
+        * driver isn't tempted to dereference data which stopped being valid
+        */
+       offload->extack = NULL;
+       offload->mqprio.extack = NULL;
        taprio_offload_free(offload);
 
        return err;