]> git.baikalelectronics.ru Git - kernel.git/commit
[SCSI] advansys: fix overrun_buf aligned bug
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Fri, 8 Feb 2008 00:50:08 +0000 (09:50 +0900)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Mon, 11 Feb 2008 16:20:53 +0000 (10:20 -0600)
commit499a8ba17d2aa412a7219bfdf14ec8e556f1c5ab
treebec3464f501145718b2426efde10b02229de4552
parent391ee3650243008683b428cfd3df6c0cb66d67a2
[SCSI] advansys: fix overrun_buf aligned bug

struct asc_dvc_var needs overrun buffer to be placed on an 8 byte
boundary. advansys defines struct asc_dvc_var:

struct asc_dvc_var {
...
uchar overrun_buf[ASC_OVERRUN_BSIZE] __aligned(8);

The problem is that struct asc_dvc_var is placed on
shost->hostdata. So if the hostdata is not on an 8 byte boundary, the
advansys crashes. The hostdata is placed on a sizeof(unsigned long)
boundary so the 8 byte boundary is not garanteed with x86_32.

With 2.6.23 and 2.6.24, the hostdata is on an 8 byte boundary by
chance, but with the current git, it's not.

This patch removes overrun_buf static array and use kzalloc.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/advansys.c