Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: memzero mp params when closing a queue

Instead of resetting memory provider parameters one by one in
__net_mp_{open,close}_rxq, memzero the entire structure. It'll be used
to extend the structure.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>

+4 -6
+4 -6
net/core/netdev_rx_queue.c
··· 139 139 140 140 rxq->mp_params = *p; 141 141 ret = netdev_rx_queue_restart(dev, rxq_idx); 142 - if (ret) { 143 - rxq->mp_params.mp_ops = NULL; 144 - rxq->mp_params.mp_priv = NULL; 145 - } 142 + if (ret) 143 + memset(&rxq->mp_params, 0, sizeof(rxq->mp_params)); 144 + 146 145 return ret; 147 146 } 148 147 ··· 178 179 rxq->mp_params.mp_priv != old_p->mp_priv)) 179 180 return; 180 181 181 - rxq->mp_params.mp_ops = NULL; 182 - rxq->mp_params.mp_priv = NULL; 182 + memset(&rxq->mp_params, 0, sizeof(rxq->mp_params)); 183 183 err = netdev_rx_queue_restart(dev, ifq_idx); 184 184 WARN_ON(err && err != -ENETDOWN); 185 185 }