Skip to content

Commit f029110

Browse files
committed
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2023-07-21 (i40e, iavf) This series contains updates to i40e and iavf drivers. Wang Ming corrects an error check on i40e. Jake unlocks crit_lock on allocation failure to prevent deadlock and stops re-enabling of interrupts when it's not intended for iavf. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: iavf: check for removal state before IAVF_FLAG_PF_COMMS_FAILED iavf: fix potential deadlock on allocation failure i40e: Fix an NULL vs IS_ERR() bug for debugfs_create_dir() ==================== Link: https://lore.kernel.org/r/20230721155812.1292752-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents ac2a7b1 + 91896c8 commit f029110

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

drivers/net/ethernet/intel/i40e/i40e_debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1839,7 +1839,7 @@ void i40e_dbg_pf_exit(struct i40e_pf *pf)
18391839
void i40e_dbg_init(void)
18401840
{
18411841
i40e_dbg_root = debugfs_create_dir(i40e_driver_name, NULL);
1842-
if (!i40e_dbg_root)
1842+
if (IS_ERR(i40e_dbg_root))
18431843
pr_info("init of debugfs failed\n");
18441844
}
18451845

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3250,9 +3250,6 @@ static void iavf_adminq_task(struct work_struct *work)
32503250
u32 val, oldval;
32513251
u16 pending;
32523252

3253-
if (adapter->flags & IAVF_FLAG_PF_COMMS_FAILED)
3254-
goto out;
3255-
32563253
if (!mutex_trylock(&adapter->crit_lock)) {
32573254
if (adapter->state == __IAVF_REMOVE)
32583255
return;
@@ -3261,10 +3258,13 @@ static void iavf_adminq_task(struct work_struct *work)
32613258
goto out;
32623259
}
32633260

3261+
if (adapter->flags & IAVF_FLAG_PF_COMMS_FAILED)
3262+
goto unlock;
3263+
32643264
event.buf_len = IAVF_MAX_AQ_BUF_SIZE;
32653265
event.msg_buf = kzalloc(event.buf_len, GFP_KERNEL);
32663266
if (!event.msg_buf)
3267-
goto out;
3267+
goto unlock;
32683268

32693269
do {
32703270
ret = iavf_clean_arq_element(hw, &event, &pending);
@@ -3279,7 +3279,6 @@ static void iavf_adminq_task(struct work_struct *work)
32793279
if (pending != 0)
32803280
memset(event.msg_buf, 0, IAVF_MAX_AQ_BUF_SIZE);
32813281
} while (pending);
3282-
mutex_unlock(&adapter->crit_lock);
32833282

32843283
if (iavf_is_reset_in_progress(adapter))
32853284
goto freedom;
@@ -3323,6 +3322,8 @@ static void iavf_adminq_task(struct work_struct *work)
33233322

33243323
freedom:
33253324
kfree(event.msg_buf);
3325+
unlock:
3326+
mutex_unlock(&adapter->crit_lock);
33263327
out:
33273328
/* re-enable Admin queue interrupt cause */
33283329
iavf_misc_irq_enable(adapter);

0 commit comments

Comments
 (0)