]> pilppa.org Git - linux-2.6-omap-h63xx.git/commit
[PATCH] coverity: i386: scsi_lib buffer overrun fix
authorKAMBAROV, ZAUR <kambarov@berkeley.edu>
Wed, 29 Jun 2005 03:45:06 +0000 (20:45 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 29 Jun 2005 04:20:33 +0000 (21:20 -0700)
commita77e3362a224212d9d3b9e6fdec44df2eef6cf92
tree5ebf2ebc3df91674101b6a5591753ee1d999abea
parenta8f5034540195307362d071a8b387226b410469f
[PATCH] coverity: i386: scsi_lib buffer overrun fix

The check in

627   BUG_ON(index > SG_MEMPOOL_NR);

with SG_MEMPOOL_NR defined in

32    #define SG_MEMPOOL_NR (sizeof(scsi_sg_pools)/sizeof(struct scsi_host_sg_pool))

was not sufficient.

sgp, set in

629   sgp = scsi_sg_pools + index;

is dereferenced in

630   mempool_free(sgl, sgp->pool);

Signed-off-by: Zaur Kambarov <zkambarov@coverity.com>
Cc: <linux-scsi@vger.kernel.org>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/scsi/scsi_lib.c