]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
accel/qaic: fix incorrect counter check in RAS message decode
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Fri, 10 Apr 2026 11:20:12 +0000 (04:20 -0700)
committerJeff Hugo <jeff.hugo@oss.qualcomm.com>
Fri, 1 May 2026 21:14:25 +0000 (15:14 -0600)
The UE and UE_NF cases check ce_count against UINT_MAX before incrementing
their respective counters. This is logically incorrect and prevents
ue_count and ue_nf_count from incrementing when ce_count reaches UINT_MAX.

Fixes: c11a50b170e7 ("accel/qaic: Add Reliability, Accessibility, Serviceability (RAS)")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
Signed-off-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
Link: https://patch.msgid.link/20260410112015.592546-1-alok.a.tiwari@oracle.com
drivers/accel/qaic/qaic_ras.c

index cc0b75461e1ac3c6f42fd630d9e3e12d0ca8e16d..6791af366cba7364f2b252c767ce06c342c45d3a 100644 (file)
@@ -497,11 +497,11 @@ static void decode_ras_msg(struct qaic_device *qdev, struct ras_data *msg)
                        qdev->ce_count++;
                break;
        case UE:
-               if (qdev->ce_count != UINT_MAX)
+               if (qdev->ue_count != UINT_MAX)
                        qdev->ue_count++;
                break;
        case UE_NF:
-               if (qdev->ce_count != UINT_MAX)
+               if (qdev->ue_nf_count != UINT_MAX)
                        qdev->ue_nf_count++;
                break;
        default: