ipr: Fix incorrect trace indexing
authorBrian King <brking@linux.vnet.ibm.com>
Tue, 14 Jul 2015 16:41:31 +0000 (11:41 -0500)
committerJames Bottomley <JBottomley@Odin.com>
Thu, 30 Jul 2015 17:38:00 +0000 (10:38 -0700)
commitbb7c54339e6a10ecce5c4961adf5e75b3cf0af30
tree415cedd069567d7be55d8da522207069cff4e634
parent36b8e180e1e929e00b351c3b72aab3147fc14116
ipr: Fix incorrect trace indexing

When ipr's internal driver trace was changed to an atomic, a signed/unsigned
bug slipped in which results in us indexing backwards in our memory buffer
writing on memory that does not belong to us. This patch fixes this by removing
the modulo and instead just mask off the low bits.

Cc: <stable@vger.kernel.org>
Tested-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Reviewed-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
drivers/scsi/ipr.c
drivers/scsi/ipr.h