diff mbox series

[net-next] ionic: fix a sleeping in atomic bug

Message ID 20210903131856.GA25934@kili (mailing list archive)
State Accepted
Delegated to: Netdev Maintainers
Headers show
Series [net-next] ionic: fix a sleeping in atomic bug | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Dan Carpenter Sept. 3, 2021, 1:18 p.m. UTC
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>
---
 drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Shannon Nelson Sept. 3, 2021, 3:14 p.m. UTC | #1
On 9/3/21 6:18 AM, Dan Carpenter wrote:
> 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>

> ---
>   drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c b/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
> index 7e3a5634c161..25ecfcfa1281 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
> @@ -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;
>
Jakub Kicinski Sept. 3, 2021, 11:17 p.m. UTC | #2
On Fri, 3 Sep 2021 08:14:25 -0700 Shannon Nelson wrote:
> On 9/3/21 6:18 AM, Dan Carpenter wrote:
> > 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>

Applied, thanks!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c b/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
index 7e3a5634c161..25ecfcfa1281 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
@@ -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;