From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ralph Campbell Date: Sun, 11 Oct 2020 20:58:14 +0000 Subject: Re: [PATCH] mm/hmm/test: Fix an error code in dmirror_allocate_chunk() Message-Id: List-Id: References: <20201010200812.GA1886610@mwanda> In-Reply-To: <20201010200812.GA1886610@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dan Carpenter , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= Cc: Stephen Rothwell , Jason Gunthorpe , Dan Williams , Andrew Morton , linux-mm@kvack.org, kernel-janitors@vger.kernel.org On 10/10/20 1:08 PM, Dan Carpenter wrote: > This is supposed to return false on failure, not a negative error code. > > Fixes: 170e38548b81 ("mm/hmm/test: use after free in dmirror_allocate_chunk()") > Signed-off-by: Dan Carpenter > --- > I messed this up earlier... My devel version of Smatch prints too much > garbage so I missed the warning when I first wrote the patch. :/ > Sorry. > > lib/test_hmm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/test_hmm.c b/lib/test_hmm.c > index e151a7f10519..80a78877bd93 100644 > --- a/lib/test_hmm.c > +++ b/lib/test_hmm.c > @@ -461,7 +461,7 @@ static bool dmirror_allocate_chunk(struct dmirror_device *mdevice, > > devmem = kzalloc(sizeof(*devmem), GFP_KERNEL); > if (!devmem) > - return -ENOMEM; > + return false; > > res = request_free_mem_region(&iomem_resource, DEVMEM_CHUNK_SIZE, > "hmm_dmirror"); Thanks for fixing this. Reviewed-by: Ralph Campbell From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4939FC433DF for ; Sun, 11 Oct 2020 20:58:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AB15320791 for ; Sun, 11 Oct 2020 20:58:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="XQk8IZPa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AB15320791 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DFC29900004; Sun, 11 Oct 2020 16:58:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DAD33900002; Sun, 11 Oct 2020 16:58:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CC26E900004; Sun, 11 Oct 2020 16:58:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0208.hostedemail.com [216.40.44.208]) by kanga.kvack.org (Postfix) with ESMTP id 9E295900002 for ; Sun, 11 Oct 2020 16:58:18 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 1E689181AE866 for ; Sun, 11 Oct 2020 20:58:18 +0000 (UTC) X-FDA: 77360857476.27.title20_4c12469271f4 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id F2DAA3D663 for ; Sun, 11 Oct 2020 20:58:17 +0000 (UTC) X-HE-Tag: title20_4c12469271f4 X-Filterd-Recvd-Size: 3346 Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Sun, 11 Oct 2020 20:58:17 +0000 (UTC) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Sun, 11 Oct 2020 13:56:22 -0700 Received: from rcampbell-dev.nvidia.com (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sun, 11 Oct 2020 20:58:15 +0000 Subject: Re: [PATCH] mm/hmm/test: Fix an error code in dmirror_allocate_chunk() To: Dan Carpenter , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= CC: Stephen Rothwell , Jason Gunthorpe , Dan Williams , Andrew Morton , , References: <20201010200812.GA1886610@mwanda> From: Ralph Campbell Message-ID: Date: Sun, 11 Oct 2020 13:58:14 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20201010200812.GA1886610@mwanda> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1602449782; bh=3gzE4h0sY7m4wDIeJCED4vDnvda9FNSHqpTCIrN3G9s=; h=Subject:To:CC:References:From:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type:Content-Language: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy; b=XQk8IZPavTeGcChntTFGGo6lIZrqGett6cNtpY97nteyToTBOj/u2CcKi7g+7Yute QU2Zi6G8Yp6iiU9q2o7caBUtyckM9aEh30+xBPNbmx2pFvMppbhP7hGGlGwTYvgZg1 258mDlEGmZwJldRw73aS7D+/iCHTXTjJnGAzwav5TLmiv4Xp/H0dCG//ItD6WIgDmo WQ2S7n2k6AOQFKTH+OH7pHUlziOZiwPGQPuyTWcqs1xdHZozeF8E413yDiNNV2vm/f a0q5De4KQlCvGfcP8zqU0qK6zwT2MQqy0wcUzxyCCC02mwZmGmCDhHmUsBcYjNuHDw Mf08ZRGfejiYw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 10/10/20 1:08 PM, Dan Carpenter wrote: > This is supposed to return false on failure, not a negative error code. > > Fixes: 170e38548b81 ("mm/hmm/test: use after free in dmirror_allocate_chunk()") > Signed-off-by: Dan Carpenter > --- > I messed this up earlier... My devel version of Smatch prints too much > garbage so I missed the warning when I first wrote the patch. :/ > Sorry. > > lib/test_hmm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/test_hmm.c b/lib/test_hmm.c > index e151a7f10519..80a78877bd93 100644 > --- a/lib/test_hmm.c > +++ b/lib/test_hmm.c > @@ -461,7 +461,7 @@ static bool dmirror_allocate_chunk(struct dmirror_device *mdevice, > > devmem = kzalloc(sizeof(*devmem), GFP_KERNEL); > if (!devmem) > - return -ENOMEM; > + return false; > > res = request_free_mem_region(&iomem_resource, DEVMEM_CHUNK_SIZE, > "hmm_dmirror"); Thanks for fixing this. Reviewed-by: Ralph Campbell