accel/qaic: Add consistent integer overflow checks
authorDan Carpenter <dan.carpenter@linaro.org>
Tue, 11 Jul 2023 08:21:00 +0000 (11:21 +0300)
committerJeffrey Hugo <quic_jhugo@quicinc.com>
Fri, 14 Jul 2023 16:12:05 +0000 (10:12 -0600)
commit47d87f71d00b7091b43a56f608f7151b33e5772e
tree362a07cd0223b337fe43a584e2acf6f861c8e8cb
parent51b56382ed2a2b03347372272362b3baa623ed1e
accel/qaic: Add consistent integer overflow checks

The encode_dma() function has integer overflow checks.  The
encode_passthrough(), encode_activate() and encode_status() functions
did not.  I added integer overflow checking everywhere.  I also
updated the integer overflow checking in encode_dma() to use size_add()
so everything is consistent.

Fixes: 129776ac2e38 ("accel/qaic: Add control path")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Pranjal Ramajor Asha Kanojiya <quic_pkanojiy@quicinc.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Cc: stable@vger.kernel.org # 6.4.x
[jhugo: tweak if in encode_dma() to match existing style]
Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ZK0Q7IsPkj6WSCcL@moroto
drivers/accel/qaic/qaic_control.c