[SCSI] libsas: Fix potential NULL dereference in sas_smp_get_phy_events()
authorJesper Juhl <jesper.juhl@gmail.com>
Fri, 27 Jul 2007 23:13:33 +0000 (01:13 +0200)
committerJames Bottomley <jejb@mulgrave.localdomain>
Sat, 28 Jul 2007 14:58:28 +0000 (10:58 -0400)
commit92631fa4d0afa64b82144eab714fbf2f4049dabe
tree9d885b3d23c72241dff4b5bbaf2dca88b4c05ea3
parent99d4d0a9f251a87e0710c6f1fb46ac0d4bce12cb
[SCSI] libsas: Fix potential NULL dereference in sas_smp_get_phy_events()

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 memory allocation in that
function.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/libsas/sas_expander.c