All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: santosh nayak <santoshprasadnayak@gmail.com>,
	jack_wang@usish.com, mark_salyzyn@xyratex.com,
	lindar_liu@usish.com, linux-scsi@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] [SCSI] pm8001: Add error handler in pm8001_init_sas_add() if kzalloc fails.
Date: Wed, 21 Mar 2012 08:58:46 +0000	[thread overview]
Message-ID: <20120321085846.GB3967@mwanda> (raw)
In-Reply-To: <1332319785.2909.11.camel@dabdike.int.hansenpartnership.com>

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

On Wed, Mar 21, 2012 at 08:49:45AM +0000, James Bottomley wrote:
> On Wed, 2012-03-21 at 14:08 +0530, santosh nayak wrote:
> > From: Santosh Nayak <santoshprasadnayak@gmail.com>
> > 
> > We need to add error handler if kzalloc fails to allocate and initialize.
> > Otherwise it may lead to Null derefernce error in 
> > 'pm8001_chip_get_nvmd_req()'.
> 
> It's a GFP_KERNEL allocation.  They sleep until memory is available
> (__GFP_WAIT).  It's GFP_ATOMIC that can return NULL.
> 

That's not right at all.  Only __GFP_NOFAIL allocations don't need
to be checked.

regards,
dan carpenter


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: santosh nayak <santoshprasadnayak@gmail.com>,
	jack_wang@usish.com, mark_salyzyn@xyratex.com,
	lindar_liu@usish.com, linux-scsi@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] [SCSI] pm8001: Add error handler in pm8001_init_sas_add() if kzalloc fails.
Date: Wed, 21 Mar 2012 11:58:46 +0300	[thread overview]
Message-ID: <20120321085846.GB3967@mwanda> (raw)
In-Reply-To: <1332319785.2909.11.camel@dabdike.int.hansenpartnership.com>

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

On Wed, Mar 21, 2012 at 08:49:45AM +0000, James Bottomley wrote:
> On Wed, 2012-03-21 at 14:08 +0530, santosh nayak wrote:
> > From: Santosh Nayak <santoshprasadnayak@gmail.com>
> > 
> > We need to add error handler if kzalloc fails to allocate and initialize.
> > Otherwise it may lead to Null derefernce error in 
> > 'pm8001_chip_get_nvmd_req()'.
> 
> It's a GFP_KERNEL allocation.  They sleep until memory is available
> (__GFP_WAIT).  It's GFP_ATOMIC that can return NULL.
> 

That's not right at all.  Only __GFP_NOFAIL allocations don't need
to be checked.

regards,
dan carpenter


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-03-21  8:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-21  8:38 [PATCH] [SCSI] pm8001: Add error handler in pm8001_init_sas_add() if kzalloc fails santosh nayak
2012-03-21  8:50 ` santosh nayak
2012-03-21  8:49 ` James Bottomley
2012-03-21  8:58   ` Dan Carpenter [this message]
2012-03-21  8:58     ` Dan Carpenter
2012-03-21 10:11     ` James Bottomley
2012-03-21 10:50   ` walter harms
2012-03-21 11:06   ` Dan Carpenter
2012-03-21 17:11 ` Mark Salyzyn
2012-03-21 17:11   ` Mark Salyzyn
2012-03-22  1:49 ` Jack Wang
2012-03-22  1:49   ` Jack Wang

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=20120321085846.GB3967@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=jack_wang@usish.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lindar_liu@usish.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mark_salyzyn@xyratex.com \
    --cc=santoshprasadnayak@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.