]> Git Repo - J-linux.git/commitdiff
vfio/fsl-mc: fix the return of the uninitialized variable ret
authorDiana Craciun <[email protected]>
Fri, 16 Oct 2020 09:32:32 +0000 (12:32 +0300)
committerAlex Williamson <[email protected]>
Mon, 19 Oct 2020 13:09:41 +0000 (07:09 -0600)
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 <[email protected]>
Signed-off-by: Diana Craciun <[email protected]>
Signed-off-by: Alex Williamson <[email protected]>
drivers/vfio/fsl-mc/vfio_fsl_mc.c

index 80fc7f4ed343bfc2c37252c5dcb649fd6fb74f3d..0113a980f974955a42812ba8e8ef54038617ffd1 100644 (file)
@@ -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)) {
This page took 0.058828 seconds and 4 git commands to generate.