Re: [PATCH][sas] Fix potential NULL pointer dereference bug in sas_smp_get_phy_events()

2007-07-27 Thread Jesper Juhl
On 28/07/07, James Bottomley <[EMAIL PROTECTED]> wrote: > On Fri, 2007-07-27 at 23:27 +0200, Jesper Juhl wrote: > > In sas_smp_get_phy_events() we never test if the call to > > alloc_smp_req(RPEL_REQ_SIZE) succeeds or fails. That means we run > > the risk of dereferencing a NULL pointer if it doe

Re: [PATCH][sas] Fix potential NULL pointer dereference bug in sas_smp_get_phy_events()

2007-07-27 Thread James Bottomley
On Fri, 2007-07-27 at 23:27 +0200, Jesper Juhl wrote: > In sas_smp_get_phy_events() we never test if the call to > alloc_smp_req(RPEL_REQ_SIZE) succeeds or fails. That means we run > the risk of dereferencing a NULL pointer if it does fail. Far > better to test if we got NULL back and in that ca

[PATCH][sas] Fix potential NULL pointer dereference bug in sas_smp_get_phy_events()

2007-07-27 Thread Jesper Juhl
Hello, In sas_smp_get_phy_events() we never test if the call to alloc_smp_req(RPEL_REQ_SIZE) succeeds or fails. That means we run the risk of dereferencing a NULL pointer if it does fail. Far better to test if we got NULL back and in that case return -ENOMEM just as we already do for the other