In the function sdxc_send_cmd: logging the error could use the uninitialized variable `why`, this can be the case when the sunxi_mmc_send_cmd function returns very early with the -EINVAL error code. This doesnt needs to be logged. Also add a default value for the variable.
Signed-off-by: Jules Maselbas <[email protected]> --- drivers/mci/sunxi-mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mci/sunxi-mmc.c b/drivers/mci/sunxi-mmc.c index a19abbe55d..376ef2c0a9 100644 --- a/drivers/mci/sunxi-mmc.c +++ b/drivers/mci/sunxi-mmc.c @@ -24,11 +24,11 @@ static int sdxc_send_cmd(struct mci_host *mci, struct mci_cmd *cmd, struct mci_d { struct sunxi_mmc_host *host = to_sunxi_mmc_host(mci); struct device *dev = mci->hw_dev; - const char *why; + const char *why = ""; int ret; ret = sunxi_mmc_send_cmd(host, cmd, data, &why); - if (ret && ret != -ETIMEDOUT) + if (ret && ret != -ETIMEDOUT && ret != -EINVAL) dev_err(dev, "error %s CMD%d (%d)\n", why, cmd->cmdidx, ret); if (ret == -ETIMEDOUT) mdelay(1); -- 2.48.1
