Return-Path: Message-Id: <20130813155833.394040945@goodmis.org> Date: Tue, 13 Aug 2013 11:57:56 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ben Hutchings , James Bottomley Subject: [62/88] sd: Fix parsing of temporary cache mode prefix References: <20130813155654.069291373@goodmis.org> Content-Disposition: inline; filename=0062-sd-Fix-parsing-of-temporary-cache-mode-prefix.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: 3.6.11.7-rc1 stable review patch. If anyone has any objections, please let me know. ------------------ From: Ben Hutchings [ Upstream commit 2ee3e26c673e75c05ef8b914f54fadee3d7b9c88 ] 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 Cc: stable@vger.kernel.org Signed-off-by: James Bottomley Signed-off-by: Steven Rostedt --- drivers/scsi/sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 88ced02..a2ecd324 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -141,7 +141,7 @@ sd_store_cache_type(struct device *dev, struct device_attribute *attr, char *buffer_data; struct scsi_mode_data data; struct scsi_sense_hdr sshdr; - const char *temp = "temporary "; + static const char temp[] = "temporary "; int len; if (sdp->type != TYPE_DISK) -- 1.7.10.4