Skip to content

Commit

Permalink
i3c/master: Fix uninitialized variable next_addr
Browse files Browse the repository at this point in the history
The variable next_addr is not initialized and is being used in a call
to i3c_master_get_free_addr as a starting point to find the next address.
Fix this by initializing next_addr to 0 to avoid an uninitialized garbage
starting address from being used.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: 9ad9a52 ("i3c/master: introduce the mipi-i3c-hci driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Nicolas Pitre <npitre@baylibre.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://lore.kernel.org/linux-i3c/20201124123504.396249-1-colin.king@canonical.com
  • Loading branch information
Colin Ian King authored and Boris Brezillon committed Nov 25, 2020
1 parent 9ad9a52 commit 8e34573
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/i3c/master/mipi-i3c-hci/cmd_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ static int hci_cmd_v1_daa(struct i3c_hci *hci)
{
struct hci_xfer *xfer;
int ret, dat_idx = -1;
u8 next_addr;
u8 next_addr = 0;
u64 pid;
unsigned int dcr, bcr;
DECLARE_COMPLETION_ONSTACK(done);
Expand Down

0 comments on commit 8e34573

Please sign in to comment.