netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Jia-Ju Bai <baijiaju1990@163.com>,
	David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org
Cc: todd.fujinaka@intel.com, Linux-nics@isotope.jf.intel.com,
	linux.nics@intel.com, e1000-devel@lists.sourceforge.net
Subject: Re: [PATCH V2 1/2] e100 in linux-3.18.0: Fix null pointer deference in e100_probe
Date: Sun, 21 Dec 2014 17:02:33 +0300	[thread overview]
Message-ID: <5496D2F9.4070306@cogentembedded.com> (raw)
In-Reply-To: <5496203F.9000000@163.com>

On 12/21/2014 4:19 AM, Jia-Ju Bai wrote:

    Please don't send HTML to this mailing list -- your mail may be ignored by 
the list server.

> The driver lacks the check of nic->cbs_pool after pci_pool_create in e100_probe. So when this function is failed, the null pointer dereference occurs when pci_pool_alloc uses nic->cbs_pool in e100_alloc_cbs.

    Same comment as for the previous patch about wrapping at 80 columns.

> This patch fix this problem, and it has been tested in runtime.

> Signed-off-by: Jia-Ju Bai<baijiaju1990@163.com>
> ---
>   drivers/net/ethernet/intel/e100.c     |   6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
> index 781065e..ba1813f 100644
> --- a/drivers/net/ethernet/intel/e100.c
> +++ b/drivers/net/ethernet/intel/e100.c
> @@ -2969,6 +2969,10 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>                 nic->params.cbs.max * sizeof(struct cb),
>                 sizeof(u32),
>                 0);
> +   if (!nic->cbs_pool) {
> +       err = -ENOMEM;
> +       goto err_out_pool;
> +   }

    Looks like tabs got converted to spaces by your mailer, thus the patch 
can't be applied. Consider using 'git send-email' instead.

[...]

WBR, Sergei

  reply	other threads:[~2014-12-21 14:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-20 14:32 [PATCH] e100 in linux-3.18.0: some potential bugs Jia-Ju Bai
2014-12-20 15:07 ` Sergei Shtylyov
2014-12-20 19:30 ` David Miller
2014-12-21  0:52   ` [PATCH V2] e1000: Add netif_napi_del in the normal path and error path to match netif_napi_add Jia-Ju Bai
2014-12-21 13:57     ` Sergei Shtylyov
2014-12-21  1:19   ` [PATCH V2 1/2] e100 in linux-3.18.0: Fix null pointer deference in e100_probe Jia-Ju Bai
2014-12-21 14:02     ` Sergei Shtylyov [this message]
2014-12-21  1:51   ` [PATCH V2 2/2] e100 in linux-3.18.0: Add netif_napi_del in the normal path and error path to match netif_napi_add Jia-Ju Bai

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=5496D2F9.4070306@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=Linux-nics@isotope.jf.intel.com \
    --cc=baijiaju1990@163.com \
    --cc=davem@davemloft.net \
    --cc=e1000-devel@lists.sourceforge.net \
    --cc=linux.nics@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=todd.fujinaka@intel.com \
    /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).