Merge branch 'ib/5.17-cros-ec-keyb' into next
[platform/kernel/linux-starfive.git] / drivers / usb / gadget / function / rndis.c
index 00b3f6b..713efd9 100644 (file)
@@ -640,6 +640,7 @@ static int rndis_set_response(struct rndis_params *params,
        BufLength = le32_to_cpu(buf->InformationBufferLength);
        BufOffset = le32_to_cpu(buf->InformationBufferOffset);
        if ((BufLength > RNDIS_MAX_TOTAL_SIZE) ||
+           (BufOffset > RNDIS_MAX_TOTAL_SIZE) ||
            (BufOffset + 8 >= RNDIS_MAX_TOTAL_SIZE))
                    return -EINVAL;