gpu: pvr: fix typo in SGXDoKickBW
authorImre Deak <imre.deak@nokia.com>
Thu, 14 Oct 2010 12:00:04 +0000 (15:00 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 20 May 2012 18:09:42 +0000 (21:09 +0300)
This leads to the IOCTL failing in case the new structure format is used
with it. Also fixes bounds checking for the old format.

Signed-off-by: Imre Deak <imre.deak@nokia.com>
pvr/bridged_sgx_bridge.c

index ff80932..30b7a73 100644 (file)
@@ -166,7 +166,7 @@ int SGXDoKickBW(u32 ui32BridgeID,
        PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SGX_DOKICK);
 
        max_3dstat_vals = SGX_MAX_3D_STATUS_VALS;
-       if (unlikely(in_size) != sizeof(*psDoKickIN)) {
+       if (unlikely(in_size != sizeof(*psDoKickIN))) {
                max_3dstat_vals = SGX_MAX_3D_STATUS_VALS_OLD;
                if (kick_compat_conv(psDoKickIN, in_size) != 0) {
                        psRetOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
@@ -254,7 +254,7 @@ int SGXDoKickBW(u32 ui32BridgeID,
                        return 0;
        }
 
-       if (psDoKickIN->sCCBKick.ui32Num3DStatusVals > SGX_MAX_3D_STATUS_VALS) {
+       if (psDoKickIN->sCCBKick.ui32Num3DStatusVals > max_3dstat_vals) {
                psRetOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
                return 0;
        }