projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8ba7b0a
)
Allocate 96 bytes for SCSI sense data reply
author
Linus Torvalds
<torvalds@g5.osdl.org>
Tue, 7 Mar 2006 01:41:44 +0000
(17:41 -0800)
committer
Linus Torvalds
<torvalds@g5.osdl.org>
Tue, 7 Mar 2006 01:41:44 +0000
(17:41 -0800)
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>
drivers/scsi/sr_ioctl.c
patch
|
blob
|
history
diff --git
a/drivers/scsi/sr_ioctl.c
b/drivers/scsi/sr_ioctl.c
index 5d02ff4db6cc1e050d94ee83fa24899d9dc9050a..b65462f764849bce89b7c7213a4881a1e4abb40c 100644
(file)
--- a/
drivers/scsi/sr_ioctl.c
+++ b/
drivers/scsi/sr_ioctl.c
@@
-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;