From: adam radford Date: Thu, 13 Oct 2011 23:01:12 +0000 (-0700) Subject: [SCSI] megaraid_sas: Fix instance access in megasas_reset_timer X-Git-Tag: v3.2-rc1~125^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f575c5d3ebdca3b0482847d8fcba971767754a9e;p=pandora-kernel.git [SCSI] megaraid_sas: Fix instance access in megasas_reset_timer The following patch for megaraid_sas will fix a potential bad pointer access in megasas_reset_timer(), when a MegaRAID 9265/9285 or 9360/9380 gets a timeout. megasas_build_io_fusion() sets SCp.ptr to be a struct megasas_cmd_fusion *, but then megasas_reset_timer() was casting SCp.ptr to be a struct megasas_cmd *, then trying to access cmd->instance, which is invalid. Just loading instance from scmd->device->host->hostdata in megasas_reset_timer() fixes the issue. Signed-off-by: Adam Radford Cc: stable@kernel.org Signed-off-by: James Bottomley --- Reading git-diff-tree failed