Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2748387pxb; Mon, 19 Apr 2021 12:54:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQxQ5qivXfLCd2JK7TpAZ8++t8ixlAsLSxwzwnAPY16VO6yLUcT1/y/yvwViTZzumu7Cuu X-Received: by 2002:a17:90a:8410:: with SMTP id j16mr804768pjn.120.1618862086160; Mon, 19 Apr 2021 12:54:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618862086; cv=none; d=google.com; s=arc-20160816; b=JxV6UyENWP7t4mnd7Lo6BDQAcFGF3JRnWm7L1GlYnoAvuJ6e6/huZGL0mL4gfygf2y oSv78zpqXieo6ghJ5JvhMB+GJE0ZbQbAqQTtsx7Wdvsm8zgpFL5wVLgVWk+ClL7y/j0m j2M9n1rsTUUDtuKNCUs/zb1aFnhbaBCYy3PXIyjcS7gEIyoMdAvlOF5nSzx5gkqIswFJ F8USfIIth5uD9/CWLdvpfl1lLYhYY+Mptrpsm7ac5YMETCGtekO1jnjtKZhstZobSkHk 8QodxNF5qwLbh2Yi7kyYmaTUvjVa3fzbdgTj+nO57GrR0H1zid4/o/cKn7m8X/SnMMoQ JuKQ== 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=lNpCOS4wu6k/72p88kPsbuyv/JZBdP16UBIF0JFEwjw=; b=W1zNzv6BTES9P59Tw6ZbcAkvBnPCqoU3FdJgrdXHgt4dTblJDzQfFu0kfB0ZxV0UrR PR2pqvIQeOsTpwX/TBKlCNK9cheuv6WzEqUkwBFnUjgGkO94BG+IOOrZbj6iamSwuvPB EytsD5Xwr0drBVOjHpTqd6cORSgjSGVthpu6AC7RVnewOD8cLI6OlrvQ+ar7nUMFczWd OrYx+w6Tp62MqfdKfQTvE899DxF7NZgbCyM+P68tByiYqsG8r9f/wPOOxNyaGCmZGxnf NmOsK+bVkXtJs8/qSag23v+rmu/G8zQhZrWZJ0vxbrUC+TDUONcZ+5wvAWYkWNy4hBL/ 24Zw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b1si572078pjp.3.2021.04.19.12.54.24; Mon, 19 Apr 2021 12:54:46 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237360AbhDSQGF (ORCPT + 99 others); Mon, 19 Apr 2021 12:06:05 -0400 Received: from mx2.suse.de ([195.135.220.15]:54124 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232161AbhDSQEq (ORCPT ); Mon, 19 Apr 2021 12:04:46 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 26BC0AF48; Mon, 19 Apr 2021 16:04:15 +0000 (UTC) Subject: Re: [PATCH][next] bcache: Set error return err to -ENOMEM on allocation failure To: Colin King Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, linux-bcache@vger.kernel.org, Jianpeng Ma , Jens Axboe , Kent Overstreet References: <20210419125628.177047-1-colin.king@canonical.com> From: Coly Li Message-ID: <85f515b5-05a0-5844-bed7-0287f845f491@suse.de> Date: Tue, 20 Apr 2021 00:04:10 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <20210419125628.177047-1-colin.king@canonical.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/19/21 8:56 PM, Colin King wrote: > From: Colin Ian King > > Currently when ns fails to be allocated the error return path returns > an uninitialized return code in variable 'err'. Fix this by setting > err to -ENOMEM. > > Addresses-Coverity: ("Uninitialized scalar variable") > Fixes: 688330711e9a ("bcache: initialize the nvm pages allocator") > Signed-off-by: Colin Ian King > --- > drivers/md/bcache/nvm-pages.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/md/bcache/nvm-pages.c b/drivers/md/bcache/nvm-pages.c > index 08cd45e90481..2e124d546099 100644 > --- a/drivers/md/bcache/nvm-pages.c > +++ b/drivers/md/bcache/nvm-pages.c > @@ -584,6 +584,7 @@ struct bch_nvm_namespace *bch_register_namespace(const char *dev_path) > return ERR_PTR(PTR_ERR(bdev)); > } > > + err = -ENOMEM; > ns = kzalloc(sizeof(struct bch_nvm_namespace), GFP_KERNEL); > if (!ns) > goto bdput; > Copied, added into my queue for rc1. Thanks. Coly Li