From d421a6465c48caa98338c34edddf78c0f761eb76 Mon Sep 17 00:00:00 2001 From: Manish Bhardwaj Date: Mon, 17 Jul 2023 07:32:44 +0000 Subject: [PATCH] storage: fix cert-c issue in tegra_hv driver Using this patch we are fixing below cert error:- 1. check_return: Calling tegra_ivc_init without checking return value (as is done elsewhere 42 out of 52 times). CID 10177835 Bug 3512545 Change-Id: I625914bbeee69718689d23da942feec9f05e9236 Signed-off-by: Manish Bhardwaj Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2937650 Reviewed-by: svcacv Reviewed-by: Sachin Nikam GVS: Gerrit_Virtual_Submit --- drivers/virt/tegra/tegra_hv.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/virt/tegra/tegra_hv.c b/drivers/virt/tegra/tegra_hv.c index 4ef86dd8..d7304117 100644 --- a/drivers/virt/tegra/tegra_hv.c +++ b/drivers/virt/tegra/tegra_hv.c @@ -316,8 +316,12 @@ static int tegra_hv_add_ivc(struct tegra_hv_data *hvd, INFO("adding ivc%u: rx_base=%lx tx_base = %lx size=%x irq = %d (%lu)\n", qd->id, rx_base, tx_base, qd->size, ivc->irq, d->hwirq); - tegra_ivc_init(&ivc->ivc, NULL, (void *)rx_base, 0, (void *)tx_base, 0, qd->nframes, qd->frame_size, - ivc_raise_irq, ivc); + ret = tegra_ivc_init(&ivc->ivc, NULL, (void *)rx_base, 0, (void *)tx_base, 0, qd->nframes, + qd->frame_size, ivc_raise_irq, ivc); + if (ret != 0) { + ERR("failed to init ivc queue #%u\n", qd->id); + return ret; + } /* We may have rebooted, so the channel could be active. */ ret = tegra_ivc_channel_sync(&ivc->ivc);