Skip to content

Commit

Permalink
media: venus: Use struct_size_t() helper in pkt_session_unset_buffers()
Browse files Browse the repository at this point in the history
Prefer struct_size_t() over struct_size() when no pointer instance
of the structure type is present.

Signed-off-by: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Reviewed-by: Vikash Garodia <quic_vgarodia@quicinc.com>
Link: https://lore.kernel.org/r/ZKBfoqSl61jfpO2r@work
Signed-off-by: Kees Cook <keescook@chromium.org>
  • Loading branch information
Gustavo A. R. Silva authored and Kees Cook committed Jul 27, 2023
1 parent a8f014e commit cdddb62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/media/platform/qcom/venus/hfi_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ int pkt_session_unset_buffers(struct hfi_session_release_buffer_pkt *pkt,

pkt->extradata_size = 0;
pkt->shdr.hdr.size =
struct_size((struct hfi_session_set_buffers_pkt *)0,
buffer_info, bd->num_buffers);
struct_size_t(struct hfi_session_set_buffers_pkt,
buffer_info, bd->num_buffers);
}

pkt->response_req = bd->response_required;
Expand Down

0 comments on commit cdddb62

Please sign in to comment.