Skip to content

Commit

Permalink
hid: intel-ish-hid: Fix uninitialized variable 'rv' in ish_fw_xfer_di…
Browse files Browse the repository at this point in the history
…rect_dma

commit d41bff0 upstream.

Fix the uninitialized symbol 'rv' in the function ish_fw_xfer_direct_dma
to resolve the following warning from the smatch tool:
drivers/hid/intel-ish-hid/ishtp-fw-loader.c:714 ish_fw_xfer_direct_dma()
error: uninitialized symbol 'rv'.
Initialize 'rv' to 0 to prevent undefined behavior from uninitialized
access.

Cc: [email protected]
Fixes: 91b2281 ("HID: intel-ish-hid: ISH firmware loader client driver")
Signed-off-by: SurajSonawane2415 <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Benjamin Tissoires <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
SurajSonawane2415 authored and gregkh committed Oct 17, 2024
1 parent 1c4da77 commit dd2bac3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hid/intel-ish-hid/ishtp-fw-loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ static int ish_fw_xfer_direct_dma(struct ishtp_cl_data *client_data,
const struct firmware *fw,
const struct shim_fw_info fw_info)
{
int rv;
int rv = 0;
void *dma_buf;
dma_addr_t dma_buf_phy;
u32 fragment_offset, fragment_size, payload_max_size;
Expand Down

0 comments on commit dd2bac3

Please sign in to comment.