Skip to content

Commit

Permalink
media: amphion: fix UNINIT issues reported by coverity
Browse files Browse the repository at this point in the history
[ Upstream commit c224d04 ]

using uninitialized value may introduce risk

Fixes: 9f599f3 ("media: amphion: add vpu core driver")
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
mingqian-0 authored and gregkh committed Sep 13, 2023
1 parent bddd678 commit 60f6392
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/media/platform/amphion/vpu_msgs.c
Expand Up @@ -32,7 +32,7 @@ static void vpu_session_handle_start_done(struct vpu_inst *inst, struct vpu_rpc_

static void vpu_session_handle_mem_request(struct vpu_inst *inst, struct vpu_rpc_event *pkt)
{
struct vpu_pkt_mem_req_data req_data;
struct vpu_pkt_mem_req_data req_data = { 0 };

vpu_iface_unpack_msg_data(inst->core, pkt, (void *)&req_data);
vpu_trace(inst->dev, "[%d] %d:%d %d:%d %d:%d\n",
Expand Down Expand Up @@ -80,7 +80,7 @@ static void vpu_session_handle_resolution_change(struct vpu_inst *inst, struct v

static void vpu_session_handle_enc_frame_done(struct vpu_inst *inst, struct vpu_rpc_event *pkt)
{
struct vpu_enc_pic_info info;
struct vpu_enc_pic_info info = { 0 };

vpu_iface_unpack_msg_data(inst->core, pkt, (void *)&info);
dev_dbg(inst->dev, "[%d] frame id = %d, wptr = 0x%x, size = %d\n",
Expand All @@ -90,7 +90,7 @@ static void vpu_session_handle_enc_frame_done(struct vpu_inst *inst, struct vpu_

static void vpu_session_handle_frame_request(struct vpu_inst *inst, struct vpu_rpc_event *pkt)
{
struct vpu_fs_info fs;
struct vpu_fs_info fs = { 0 };

vpu_iface_unpack_msg_data(inst->core, pkt, &fs);
call_void_vop(inst, event_notify, VPU_MSG_ID_FRAME_REQ, &fs);
Expand All @@ -107,7 +107,7 @@ static void vpu_session_handle_frame_release(struct vpu_inst *inst, struct vpu_r
info.type = inst->out_format.type;
call_void_vop(inst, buf_done, &info);
} else if (inst->core->type == VPU_CORE_TYPE_DEC) {
struct vpu_fs_info fs;
struct vpu_fs_info fs = { 0 };

vpu_iface_unpack_msg_data(inst->core, pkt, &fs);
call_void_vop(inst, event_notify, VPU_MSG_ID_FRAME_RELEASE, &fs);
Expand All @@ -122,15 +122,15 @@ static void vpu_session_handle_input_done(struct vpu_inst *inst, struct vpu_rpc_

static void vpu_session_handle_pic_decoded(struct vpu_inst *inst, struct vpu_rpc_event *pkt)
{
struct vpu_dec_pic_info info;
struct vpu_dec_pic_info info = { 0 };

vpu_iface_unpack_msg_data(inst->core, pkt, (void *)&info);
call_void_vop(inst, get_one_frame, &info);
}

static void vpu_session_handle_pic_done(struct vpu_inst *inst, struct vpu_rpc_event *pkt)
{
struct vpu_dec_pic_info info;
struct vpu_dec_pic_info info = { 0 };
struct vpu_frame_info frame;

memset(&frame, 0, sizeof(frame));
Expand Down

0 comments on commit 60f6392

Please sign in to comment.