netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: Jia-Ju Bai <baijiaju1990@163.com>
Cc: netdev@vger.kernel.org
Subject: Re: Potential bugs found in ne2k-pci+8390
Date: Sun, 23 Nov 2014 03:21:15 +0000	[thread overview]
Message-ID: <1416712875.7215.36.camel@decadent.org.uk> (raw)
In-Reply-To: <000001d00607$90e5ee70$b2b1cb50$@163.com>

[-- Attachment #1: Type: text/plain, Size: 1579 bytes --]

On Sat, 2014-11-22 at 11:51 +0800, Jia-Ju Bai wrote:
> Dear Sir,
> I'm very sorry to trouble you. 
> Recently I test 15 linux device drivers and find some potential bugs both in
> Linux 3.8.6 and Linux 3.17.2. 
> 
> The target file is drivers/net/ethernet/8390/ne2k-pci.c, which is used to
> build ne2k-pci.ko. I hope you can help me check my findings:
> [1] The function request_region is called by ne2k_pci_init_one when
> initializing the ethernet card driver. But when request_region is failed,
> which means that it returns the error value, ne2k_pci_init_one returns
> immediately to halt the process. However, because pci_enable_device has been
> called before request_region in ne2k_pci_init_one, pci_disable_device should
> be called before exiting. When the driver works normally, pci_enable_device
> and pci_disable_device are called in pairs in ne2k_pci_init_one and
> ne2k_pci_remove_one. Moreover, other ethernet card drivers call
> pci_enable_device and pci_disable_device in pairs in error handling paths,
> such as r8169 and sky2.
> [2] The similar problem to [1] occurs when alloc_ei_netdev is failed in
> ne2k_pci_init_one.
> [3] The similar problem to [1] occurs when register_netdev is failed in
> ne2k_pci_init_one.
> 
> Could you help me check these findings? Thank you very much, and I'm looking
> forward to your reply.

I agree this is a real bug (or bugs).  You should send a patch to fix
this - see Documentation/SubmittingPatches.

Ben.

-- 
Ben Hutchings
Never put off till tomorrow what you can avoid all together.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

      reply	other threads:[~2014-11-23  3:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-22  3:51 Potential bugs found in ne2k-pci+8390 Jia-Ju Bai
2014-11-23  3:21 ` Ben Hutchings [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1416712875.7215.36.camel@decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=baijiaju1990@163.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).