ionic: fix a sleeping in atomic bug
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 3 Sep 2021 13:18:56 +0000 (16:18 +0300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 3 Sep 2021 23:16:51 +0000 (16:16 -0700)
This code is holding spin_lock_bh(&lif->rx_filters.lock); so the
allocation needs to be atomic.

Fixes: 969f84394604 ("ionic: sync the filters in the work task")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Link: https://lore.kernel.org/r/20210903131856.GA25934@kili
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c

index 7e3a5634c161f3552197ffbdc3af671f0ed953dd..25ecfcfa1281fd12256cd468e16c5fcdbe816289 100644 (file)
@@ -318,7 +318,7 @@ void ionic_rx_filter_sync(struct ionic_lif *lif)
                        if (f->state == IONIC_FILTER_STATE_NEW ||
                            f->state == IONIC_FILTER_STATE_OLD) {
                                sync_item = devm_kzalloc(dev, sizeof(*sync_item),
-                                                        GFP_KERNEL);
+                                                        GFP_ATOMIC);
                                if (!sync_item)
                                        goto loop_out;