Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1053190pxu; Fri, 16 Oct 2020 02:37:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxU6KG9O3ZYkNeS4mP3I8EfszVfB0PWEewWYxVuH3+wUYCxYMcIJwY4bBJs7+KfgMVnomh+ X-Received: by 2002:aa7:d844:: with SMTP id f4mr2782605eds.194.1602841022291; Fri, 16 Oct 2020 02:37:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602841022; cv=none; d=google.com; s=arc-20160816; b=u6AFj3kjZlHQWZv4n83/SlUgFqJDoZKiGyrMM/MAMzZaGhQ601rodHjVyHNlqfZqR3 7Jbo9oQtpmoJMqJY7k62XfqzjuyjatP6RXLZX+fLDjsjhHAgOWk5k/itS2tSnFQ/brVb OkU2D488si3fxK6Xj0YWtIxC6+HlPCrsRBbAf4ze+z5S8bHcZYOaIhwKdHGiEmU3+OPc H4qYt1LjhUhNLknxfj/VdnLlTkIQ19Ghprfit6vAaFUrHqhVhzrP8lzcc3JcZ40Dpyhd xUapKoMBsq0/51T0gMFF9DirjfD3VuGVkbbBBVRLXRhJsLodX1k7Q4HMMPpRzyYHesFK ZTWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=n5EjfN4ckuoPtrohHDZWb96UqBq9iKnh0IQ7RVNuJiI=; b=KNE+FAVdo6oaNIvTwicwPL6sXGnqL3++Tz2Ao5M7Ptg48TDQ6Cj9gqmOcqOByJ3aC9 lcLqJkxC3RpLyJKJMwAQIhAUWbtJ0R4vZkSfy42IJIpwgEEm/QTH126ePHVJl2pULb2Y c7+MUEpOTMFBTI+fJfrrnft1lvMdazjtmmT3egEF8XV0YhxiqyJGsKDcd4dGgsMKiHDo g5jB/1BgGLsDb4MsdZsqaWc1HjzmP0rqDcJGRQ5m7ifZxEWdDGr8ZpGt1NNde4a+7Isu S8o3oiAMeXsw2adAsW/DRgVM4ut/mRaEBFKdLL+pA2eDiVL4Xgv+ONh9vSAmRh8a4edq Y9aw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lx14si1412947ejb.115.2020.10.16.02.36.39; Fri, 16 Oct 2020 02:37:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405993AbgJPJdR (ORCPT + 99 others); Fri, 16 Oct 2020 05:33:17 -0400 Received: from inva021.nxp.com ([92.121.34.21]:33668 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394926AbgJPJdQ (ORCPT ); Fri, 16 Oct 2020 05:33:16 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 375B2200A16; Fri, 16 Oct 2020 11:33:15 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 2B014200A0D; Fri, 16 Oct 2020 11:33:15 +0200 (CEST) Received: from fsr-ub1864-111.ea.freescale.net (fsr-ub1864-111.ea.freescale.net [10.171.82.141]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id CD09D20341; Fri, 16 Oct 2020 11:33:14 +0200 (CEST) From: Diana Craciun To: alex.williamson@redhat.com, kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, laurentiu.tudor@nxp.com, colin.king@canonical.com, Diana Craciun Subject: [PATCH v2] vfio/fsl-mc: fix the return of the uninitialized variable ret Date: Fri, 16 Oct 2020 12:32:32 +0300 Message-Id: <20201016093232.12774-1-diana.craciun@oss.nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Diana Craciun --- drivers/vfio/fsl-mc/vfio_fsl_mc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)) { -- 2.17.1