ipr: Fix incorrect trace indexing
authorBrian King <brking@linux.vnet.ibm.com>
Tue, 14 Jul 2015 16:41:31 +0000 (11:41 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Aug 2015 03:51:36 +0000 (20:51 -0700)
commit615b0eb835d3d37a9339872c5c1f7ce299e7a40f
tree60a8e48b114c0b3860e0fd6c6527a37e5e8e9715
parentec8ea7c221488d7e6a05a34e2f9fafab6f39c976
ipr: Fix incorrect trace indexing

commit bb7c54339e6a10ecce5c4961adf5e75b3cf0af30 upstream.

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.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/ipr.c
drivers/scsi/ipr.h