Re: [PATCH] [SCSI] pm8001: Add error handler in pm8001_init_sas_add() if kzalloc fails.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2012-03-21 at 11:58 +0300, Dan Carpenter wrote:
> 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@xxxxxxxxx>
> > > 
> > > 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.

Ah, right, that's the option I was thinking of.  __GFP_WAIT may fail if
we're in direct reclaim or the oom killer gets activated.

James


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux