summaryrefslogtreecommitdiff
path: root/drivers/vfio
diff options
context:
space:
mode:
authorDiana Craciun <diana.craciun@oss.nxp.com>2020-10-16 12:32:32 +0300
committerAlex Williamson <alex.williamson@redhat.com>2020-10-19 16:09:41 +0300
commit822e1a90afff61826252a65e574e940c0038055c (patch)
treec88ab363d161d8961e6c85c70a888659595b81b0 /drivers/vfio
parent159246378d8483ba63844fc03027df70501552c1 (diff)
downloadlinux-822e1a90afff61826252a65e574e940c0038055c.tar.xz
vfio/fsl-mc: fix the return of the uninitialized variable ret
The vfio_fsl_mc_reflck_attach function may return, on success path, an uninitialized variable. Fix the problem by initializing the return variable to 0. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: f2ba7e8c947b ("vfio/fsl-mc: Added lock support in preparation for interrupt handling") Reported-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Diana Craciun <diana.craciun@oss.nxp.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio')
-rw-r--r--drivers/vfio/fsl-mc/vfio_fsl_mc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vfio/fsl-mc/vfio_fsl_mc.c b/drivers/vfio/fsl-mc/vfio_fsl_mc.c
index 80fc7f4ed343..0113a980f974 100644
--- a/drivers/vfio/fsl-mc/vfio_fsl_mc.c
+++ b/drivers/vfio/fsl-mc/vfio_fsl_mc.c
@@ -58,7 +58,7 @@ static struct vfio_fsl_mc_reflck *vfio_fsl_mc_reflck_alloc(void)
static int vfio_fsl_mc_reflck_attach(struct vfio_fsl_mc_device *vdev)
{
- int ret;
+ int ret = 0;
mutex_lock(&reflck_lock);
if (is_fsl_mc_bus_dprc(vdev->mc_dev)) {