Project

General

Profile

Actions

Feature #3327

open

138: NAPI context resource leaks - netif_napi_del and netif_napi_add

Added by Alexey Khoroshilov over 12 years ago. Updated about 10 years ago.

Status:
Open
Priority:
Normal
Start date:
08/07/2012
Due date:
% Done:

0%

Estimated time:
Published in build:

Description

commit ad1be8d345416a794dea39761a374032aa471a76 upstream.

when register_netdev fails, the init'ed NAPIs by netif_napi_add must be
deleted with netif_napi_del, and also when driver unloads, it should
delete the NAPI before unregistering netdevice using unregister_netdev.

http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=commitdiff;h=fc6fc50e4d74eb0f4f4c8a07b33d2a797a29082f

Also it can be checked that
'netif_napi_add() must be used to initialize a napi context prior to calling any of the other napi related functions'.

Actions #1

Updated by Ilya Shchepetkov over 12 years ago

  • Assignee set to Ilya Shchepetkov
Actions #2

Updated by Ilya Shchepetkov over 12 years ago

netif_napi_del() is called in free_netdev() in most cases. In other cases, I don't understand yet under which conditions the call is needed. So, this rule delayed for an indefinite time.

Actions #3

Updated by Alexey Khoroshilov about 12 years ago

One more example of related commit:

Napi structures are being created each time we open a port, but when
the port is closed the napi structure is only disabled but not removed.
This bug caused hang while removing the driver.

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=72876a60

Actions #4

Updated by Evgeny Novikov about 12 years ago

This rule was extracted during our commits analysis also. Here is an example

Actions #5

Updated by Ilya Shchepetkov over 11 years ago

  • Status changed from New to Resolved

Added in commit 9e5058f of master branch.

Actions #6

Updated by Evgeny Novikov about 10 years ago

  • Status changed from Resolved to Open
  • Assignee changed from Ilya Shchepetkov to Evgeny Novikov

There is commit 7cb2521 that should be in LDV Validation.

Actions

Also available in: Atom PDF