Commit 312cf3e4 authored by Ben Hutchings's avatar Ben Hutchings Committed by Greg Kroah-Hartman

SCSI: sd: Fix parsing of 'temporary ' cache mode prefix

commit 2ee3e26c upstream.

Commit 39c60a09 '[SCSI] sd: fix array cache flushing bug causing
performance problems' added temp as a pointer to "temporary " and used
sizeof(temp) - 1 as its length.  But sizeof(temp) is the size of the
pointer, not the size of the string constant.  Change temp to a static
array so that sizeof() does what was intended.
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 096bff23
...@@ -142,7 +142,7 @@ sd_store_cache_type(struct device *dev, struct device_attribute *attr, ...@@ -142,7 +142,7 @@ sd_store_cache_type(struct device *dev, struct device_attribute *attr,
char *buffer_data; char *buffer_data;
struct scsi_mode_data data; struct scsi_mode_data data;
struct scsi_sense_hdr sshdr; struct scsi_sense_hdr sshdr;
const char *temp = "temporary "; static const char temp[] = "temporary ";
int len; int len;
if (sdp->type != TYPE_DISK) if (sdp->type != TYPE_DISK)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment