1
0
Fork 0

Allocate 96 bytes for SCSI sense data reply

The SCSI layer uses SCSI_SENSE_BUFFERSIZE (96) for the sense buffer
size, even though some other code uses "sizeof(struct request_sense)"
(which is 64 bytes).  Allocate the buffer using the bigger of the two
for safety.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
hifive-unleashed-5.1
Linus Torvalds 2006-03-06 17:41:44 -08:00
parent 8ba7b0a14b
commit f716d83033
1 changed files with 1 additions and 1 deletions

View File

@ -192,7 +192,7 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc)
SDev = cd->device;
if (!sense) {
sense = kmalloc(sizeof(*sense), GFP_KERNEL);
sense = kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL);
if (!sense) {
err = -ENOMEM;
goto out;