lkml.org 
[lkml]   [2021]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.14 110/432] scsi: ufs: Fix unsigned int compared with less than zero
    Date
    From: Colin Ian King <colin.king@canonical.com>

    [ Upstream commit a5402cdcc2a925835db89ea336909b2b724189df ]

    Variable 'tag' is currently an unsigned int and is being compared to less
    than zero, this check is always false. Fix this by making 'tag' an int.

    Link: https://lore.kernel.org/r/20210806144301.19864-1-colin.king@canonical.com
    Fixes: 4728ab4a8e64 ("scsi: ufs: Remove ufshcd_valid_tag()")
    Reviewed-by: Bart Van Assche <bvanassche@acm.org>
    Signed-off-by: Colin Ian King <colin.king@canonical.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Addresses-Coverity: ("Macro compares unsigned to 0")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/scsi/ufs/ufshcd.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
    index 1708d7ced527..8275127749d2 100644
    --- a/drivers/scsi/ufs/ufshcd.c
    +++ b/drivers/scsi/ufs/ufshcd.c
    @@ -6969,7 +6969,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
    struct Scsi_Host *host;
    struct ufs_hba *hba;
    unsigned long flags;
    - unsigned int tag;
    + int tag;
    int err = FAILED;
    struct ufshcd_lrb *lrbp;
    u32 reg;
    --
    2.30.2


    \
     
     \ /
      Last update: 2021-09-16 19:20    [W:4.037 / U:0.908 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site