Merge tag 'objtool-urgent-2020-12-27' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / net / sched / sch_generic.c
index 54c4172..49eae93 100644 (file)
@@ -802,9 +802,8 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
                          const struct Qdisc_ops *ops,
                          struct netlink_ext_ack *extack)
 {
-       void *p;
        struct Qdisc *sch;
-       unsigned int size = QDISC_ALIGN(sizeof(*sch)) + ops->priv_size;
+       unsigned int size = sizeof(*sch) + ops->priv_size;
        int err = -ENOBUFS;
        struct net_device *dev;
 
@@ -815,22 +814,10 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
        }
 
        dev = dev_queue->dev;
-       p = kzalloc_node(size, GFP_KERNEL,
-                        netdev_queue_numa_node_read(dev_queue));
+       sch = kzalloc_node(size, GFP_KERNEL, netdev_queue_numa_node_read(dev_queue));
 
-       if (!p)
+       if (!sch)
                goto errout;
-       sch = (struct Qdisc *) QDISC_ALIGN((unsigned long) p);
-       /* if we got non aligned memory, ask more and do alignment ourself */
-       if (sch != p) {
-               kfree(p);
-               p = kzalloc_node(size + QDISC_ALIGNTO - 1, GFP_KERNEL,
-                                netdev_queue_numa_node_read(dev_queue));
-               if (!p)
-                       goto errout;
-               sch = (struct Qdisc *) QDISC_ALIGN((unsigned long) p);
-               sch->padded = (char *) sch - (char *) p;
-       }
        __skb_queue_head_init(&sch->gso_skb);
        __skb_queue_head_init(&sch->skb_bad_txq);
        qdisc_skb_head_init(&sch->q);
@@ -873,7 +860,7 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
 
        return sch;
 errout1:
-       kfree(p);
+       kfree(sch);
 errout:
        return ERR_PTR(err);
 }
@@ -941,7 +928,7 @@ void qdisc_free(struct Qdisc *qdisc)
                free_percpu(qdisc->cpu_qstats);
        }
 
-       kfree((char *) qdisc - qdisc->padded);
+       kfree(qdisc);
 }
 
 static void qdisc_free_cb(struct rcu_head *head)