Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1474399pxu; Thu, 8 Oct 2020 12:21:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyd6SrxO2rI38liam1lITDXmXV65Qy69hEHJJWc8QAbxWuq6H6fVa0+ZzBq8VEv9AouC1Qp X-Received: by 2002:a50:eb0a:: with SMTP id y10mr11096120edp.89.1602184907855; Thu, 08 Oct 2020 12:21:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602184907; cv=none; d=google.com; s=arc-20160816; b=I++EJmSElRcmLWw4UAPbiRhht++Rh8hrvOE3nH2NAEM8A28noptTsroPpnjL8ljIUx VP2HQyfwZ/EGeUMKK9H6FN0Vv2LY2SgaM+Klk/VKvM6uPkWthj6Dkx3DAGJSyccoILA4 xJQOfBTY8YeWwcmzjnSlskIM6rqDFkk42YPLXNwVYPwMD2P7Dl51u8Zf+Z0BINjnAN5p 3fvhCkdc59YeD2olFRfcp8GX7j3jtaySsfaFLJeYXHC7krv4Px70scAGZrtdp9e0SWSQ sVqctzj3l1pZHGdlOlxbTG6fmT/HAQQlgw4GC/eo8AapNdwUpuREeJbwfatjTYxSIwxW LXrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=hmwroAsbIoiUzW8zvU+krRlduSE+pfGpagt+OeEk3T0=; b=DIj2BneGt4oGrSiXsB3VzTcfzsRljJKmju3vcxuquxv0ceitPs0Pb9xSJtrcfQISgg vM3Y/qPf8sDGRbt/x1XOoK9c9dX/MNXNfNYHeTiV7OElOnQHzvyZUnKPbKTv9d6ip6P1 o5swLNyN09RSx6gfOLraonMVneYDrKrQY1VClgcRSREKNK/tm//KtO0bF8rnaP7dC7hw 9Jc6sQeByZqFmuDA9Zfne6gtAE5buRCGjU58UadfuD4/pIsKjKkzmWMm56pBO9fOGWdC 42DcUpUBOUTldnBl1MR2j7ZbI6vCuQxZFOaiZuKWIdsQUIT+GM48V7y5Svyx/2stuvvD r4Mw== 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=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p15si4322479edy.474.2020.10.08.12.21.24; Thu, 08 Oct 2020 12:21:47 -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=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729389AbgJHS6y (ORCPT + 99 others); Thu, 8 Oct 2020 14:58:54 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:37919 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725908AbgJHS6y (ORCPT ); Thu, 8 Oct 2020 14:58:54 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212]) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kQb7s-0006D9-IB; Thu, 08 Oct 2020 18:58:52 +0000 Subject: Re: [PATCH] scsi: qla2xxx: fix return of uninitialized value in rval To: Pavel Machek Cc: Nilesh Javali , GR-QLogic-Storage-Upstream@marvell.com, "James E . J . Bottomley" , "Martin K . Petersen" , Himanshu Madhani , linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org References: <20201008183239.200358-1-colin.king@canonical.com> <20201008184105.GA25478@duo.ucw.cz> From: Colin Ian King Message-ID: Date: Thu, 8 Oct 2020 19:58:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: <20201008184105.GA25478@duo.ucw.cz> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/10/2020 19:41, Pavel Machek wrote: > On Thu 2020-10-08 19:32:39, Colin King wrote: >> From: Colin Ian King >> >> A previous change removed the initialization of rval and there is >> now an error where an uninitialized rval is being returned on an >> error return path. Fix this by returning -ENODEV. >> >> Addresses-Coverity: ("Uninitialized scalar variable") >> Fixes: b994718760fa ("scsi: qla2xxx: Use constant when it is known") >> Signed-off-by: Colin Ian King > > Acked-by: Pavel Machek (CIP) > > And sorry, I did patch against mainline, and this got added in -next > in the meantime. Ah, that explains it. No problem, Coverity is good at finding buglets Colin > >> index ae47e0eb0311..1f9005125313 100644 >> --- a/drivers/scsi/qla2xxx/qla_nvme.c >> +++ b/drivers/scsi/qla2xxx/qla_nvme.c >> @@ -561,7 +561,7 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport, >> vha = fcport->vha; >> >> if (!(fcport->nvme_flag & NVME_FLAG_REGISTERED)) >> - return rval; >> + return -ENODEV; >> >> if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || >> (qpair && !qpair->fw_started) || fcport->deleted) >> -- >> 2.27.0 >> >