diff options
| author | Ben Hutchings <ben@decadent.org.uk> | 2013-05-27 14:07:19 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-13 14:42:27 -0400 |
| commit | 312cf3e4cf531e1f729624464bce7542025f7cbe (patch) | |
| tree | e876132520446d9a1e5d8cbac1535ce088f0eb81 /drivers/scsi | |
| parent | 096bff23937209645162a7fc5e70246cb5c60336 (diff) | |
SCSI: sd: Fix parsing of 'temporary ' cache mode prefix
commit 2ee3e26c673e75c05ef8b914f54fadee3d7b9c88 upstream.
Commit 39c60a0948cc '[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: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/scsi')
| -rw-r--r-- | drivers/scsi/sd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index c1c555242d0d..6f6a1b48f998 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
| @@ -142,7 +142,7 @@ sd_store_cache_type(struct device *dev, struct device_attribute *attr, | |||
| 142 | char *buffer_data; | 142 | char *buffer_data; |
| 143 | struct scsi_mode_data data; | 143 | struct scsi_mode_data data; |
| 144 | struct scsi_sense_hdr sshdr; | 144 | struct scsi_sense_hdr sshdr; |
| 145 | const char *temp = "temporary "; | 145 | static const char temp[] = "temporary "; |
| 146 | int len; | 146 | int len; |
| 147 | 147 | ||
| 148 | if (sdp->type != TYPE_DISK) | 148 | if (sdp->type != TYPE_DISK) |
