From: Jens Axboe <jens.axboe@oracle.com>
To: pradeep singh <pradeep.rautela@gmail.com>
Cc: trivial@kernel.org, jgarzik@pobox.com, akpm@linux-foundation.org,
netdev@vger.kernel.org
Subject: Re: [PATCH v2.6.22-rc5] cxgb2: handle possible NULL pointer dereferencing
Date: Thu, 21 Jun 2007 14:34:16 +0200 [thread overview]
Message-ID: <20070621123414.GL18863@kernel.dk> (raw)
In-Reply-To: <a901b49a0706210511l786196c8n4d5d0a084705d51c@mail.gmail.com>
On Thu, Jun 21 2007, pradeep singh wrote:
> Hi
> On 6/21/07, Jens Axboe <jens.axboe@oracle.com> wrote:
> >On Thu, Jun 21 2007, pradeep singh wrote:
> >> Hi,
> >>
> >> Chelsio's in kernel 10G driver does not checks the return value from
> >> t1_get_board_info() in cxgb2.c.
> >> t1_get_board_info may return a NULL and we still go on to dereference
> >> it in the for loop without checking for the NULL.
> >>
> >> This patch fixes this.
> >
> >Patch looks odd - bi is dereferenced a number of times after that loop
> >anyway, so I don't see your patch fixing much.
> Thanks for pointing that out Jens.
> Sorry, i pushed it in a haste :(.
> Will check again and resubmit it.
You're welcome. The first thing to do is analyze whether a NULL return
from t1_get_board_info() makes any sense. From a quick look, driver_data
should be the index into the t1 pci table. So if t1_get_board_info()
returns NULL, it must be some core bug. So I'd say either don't handle
it, or mark it with BUG_ON(), or do the !bi check and CH_ERR() a warning
and goto out_disable_pdev.
--
Jens Axboe
next prev parent reply other threads:[~2007-06-21 12:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-21 12:00 [PATCH v2.6.22-rc5] cxgb2: handle possible NULL pointer dereferencing pradeep singh
2007-06-21 12:04 ` Jens Axboe
2007-06-21 12:11 ` pradeep singh
2007-06-21 12:34 ` Jens Axboe [this message]
2007-06-21 12:42 ` pradeep singh
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=20070621123414.GL18863@kernel.dk \
--to=jens.axboe@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=jgarzik@pobox.com \
--cc=netdev@vger.kernel.org \
--cc=pradeep.rautela@gmail.com \
--cc=trivial@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