[COMMON] scsi: ufs: Fix CID 12297
authorKiwoong Kim <kwmad.kim@samsung.com>
Fri, 23 Jun 2017 06:02:20 +0000 (15:02 +0900)
committerJaeHun Jung <jh0801.jung@samsung.com>
Tue, 8 May 2018 08:21:46 +0000 (17:21 +0900)
The expression returns a signed value.
A variable to store is unsigned.
A type casting is needed.

Change-Id: Ie11d27130f6c904e08d9831796790d7666ae033f
Signed-off-by: Kiwoong Kim <kwmad.kim@samsung.com>
drivers/scsi/ufs/ufshcd.c

index 06577599c515129bc93e9df2c3ba5e9320618f89..c342a6635c3ddb902326a71cea51806f5b0c5a3f 100644 (file)
@@ -6012,10 +6012,10 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
        exynos_smc(SMC_CMD_UFS_LOG, 1, 0, hba->secure_log.paddr);
 
        if (cmd->cmnd[0] == READ_10 || cmd->cmnd[0] == WRITE_10) {
-               unsigned long lba = (cmd->cmnd[2] << 24) |
+               unsigned long lba = (unsigned long) ((cmd->cmnd[2] << 24) |
                                        (cmd->cmnd[3] << 16) |
                                        (cmd->cmnd[4] << 8) |
-                                       (cmd->cmnd[5] << 0);
+                                       (cmd->cmnd[5] << 0));
                unsigned int sct = (cmd->cmnd[7] << 8) |
                                        (cmd->cmnd[8] << 0);