linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] [SCSI] mvumi: shift wrapping bug in mvumi_delete_internal_cmd()
@ 2015-01-30 10:55 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2015-01-30 10:55 UTC (permalink / raw)
  To: James E.J. Bottomley, Jianyun Li; +Cc: linux-scsi, kernel-janitors

"m_sg->baseaddr_h" is a u32.  We shift it 32 bits before casting it to
dma_addr_t so the cast is too late.

Fixes: f0c568a478f0 ('[SCSI] mvumi: Add Marvell UMI driver')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c
index 3e6b866..e7f5485 100644
--- a/drivers/scsi/mvumi.c
+++ b/drivers/scsi/mvumi.c
@@ -322,7 +322,7 @@ static void mvumi_delete_internal_cmd(struct mvumi_hba *mhba,
 			sgd_getsz(mhba, m_sg, size);
 
 			phy_addr = (dma_addr_t) m_sg->baseaddr_l |
-				(dma_addr_t) ((m_sg->baseaddr_h << 16) << 16);
+				   (((dma_addr_t)m_sg->baseaddr_h << 16) << 16);
 
 			pci_free_consistent(mhba->pdev, size, cmd->data_buf,
 								phy_addr);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-01-30 10:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-30 10:55 [patch] [SCSI] mvumi: shift wrapping bug in mvumi_delete_internal_cmd() Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).