Received: by 10.213.65.68 with SMTP id h4csp2036737imn; Thu, 5 Apr 2018 07:59:04 -0700 (PDT) X-Google-Smtp-Source: AIpwx49iVkZNp0jGLPT+MLAnYaFIt71Ca2qxU0tz/vtSLXQ1wXFVVLEaiKY4pfzuhi4xYj6P5XbB X-Received: by 2002:a17:902:7d8e:: with SMTP id a14-v6mr941966plm.380.1522940344238; Thu, 05 Apr 2018 07:59:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522940344; cv=none; d=google.com; s=arc-20160816; b=ivl+NCqufkuyl0bhHIwJSqc1peqbUkbDj3n60qhxiFsXJlVCbKDMcorWnkigKn6g1Q 6QKW3UwSDe4fCTO/X46dehb9UPCkuMEekNl5x2Cvo+5ZOOVHhSAz9qrYUaD9dmNTwFG0 AweYIlKM5wIbQlWvTLnluv1/c7mbNpe0SyStgdrUp9qRft5ld0jbnAK9HLuR3JP2kV8L HitLn5f/eD8S3pcnqvQzfQQYuvRLg4dEuTvD0X52gazbaIo0mP3eUmrlCZ9PnQL777kw o80Ts5kEYrgYT386r5Cucr0yplZtB3UQUwRPSQ3+qNlKG+mqEm4kZu6RHmbv0piemszb ZH+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=IiB2DXGNEF81x3KgCNrHCBEsHwPrim4fijGKbRbgYH8=; b=J1ywQA28QswHyHf5F8c6evD1Jmp5gQuqL42y2o30/Eoe/xdW7JxVP323C944Isa1z5 Bl7HqWQAqn4zX1MG05hltSZawEuw6aM/oLMl3YR++3UIYfGDbdu1Yw4CgtWSJuTX7boq p2kd4zwpvwkB5WXFpl7BviWsD16U8kH+sXAgnxSCk3jjTspcIh1vjkO8duT3Oi7XWAVc 3eTeBJ8YiAD0eb6ceXFI3C2nq1/U+3hgHToAM9t5fkZdQf1DTXdx4UEHVYRHp2lZbGC0 RWLRubs/DSoFEIr6T7T7r/Kosi5xi5M3FU+YSSDyTCGMJVYNgAopZ6gLavedmsxvrChL tpkg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s187si5582449pgb.729.2018.04.05.07.58.50; Thu, 05 Apr 2018 07:59:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751434AbeDEO5b (ORCPT + 99 others); Thu, 5 Apr 2018 10:57:31 -0400 Received: from mga01.intel.com ([192.55.52.88]:9035 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751038AbeDEO53 (ORCPT ); Thu, 5 Apr 2018 10:57:29 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2018 07:57:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,411,1517904000"; d="scan'208";a="188916293" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by orsmga004.jf.intel.com with ESMTP; 05 Apr 2018 07:57:27 -0700 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1f46KM-000Wpl-N1; Thu, 05 Apr 2018 22:57:26 +0800 Date: Thu, 5 Apr 2018 22:57:26 +0800 From: kbuild test robot To: Xidong Wang Cc: kbuild-all@01.org, Andrew Morton , Vitaly Wool , Mike Rapoport , wangxidong_97@163.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] z3fold: fix memory leak Message-ID: <201804052205.ejzdZ5Qg%fengguang.wu@intel.com> References: <1522803111-29209-1-git-send-email-wangxidong_97@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1522803111-29209-1-git-send-email-wangxidong_97@163.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Xidong, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on mmotm/master] [also build test WARNING on v4.16 next-20180405] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Xidong-Wang/z3fold-fix-memory-leak/20180404-114952 base: git://git.cmpxchg.org/linux-mmotm.git master smatch warnings: mm/z3fold.c:493 z3fold_create_pool() error: potential null dereference 'pool'. (kzalloc returns null) mm/z3fold.c:493 z3fold_create_pool() error: we previously assumed 'pool' could be null (see line 465) vim +/pool +493 mm/z3fold.c 443 444 445 /* 446 * API Functions 447 */ 448 449 /** 450 * z3fold_create_pool() - create a new z3fold pool 451 * @name: pool name 452 * @gfp: gfp flags when allocating the z3fold pool structure 453 * @ops: user-defined operations for the z3fold pool 454 * 455 * Return: pointer to the new z3fold pool or NULL if the metadata allocation 456 * failed. 457 */ 458 static struct z3fold_pool *z3fold_create_pool(const char *name, gfp_t gfp, 459 const struct z3fold_ops *ops) 460 { 461 struct z3fold_pool *pool = NULL; 462 int i, cpu; 463 464 pool = kzalloc(sizeof(struct z3fold_pool), gfp); > 465 if (!pool) 466 goto out; 467 spin_lock_init(&pool->lock); 468 spin_lock_init(&pool->stale_lock); 469 pool->unbuddied = __alloc_percpu(sizeof(struct list_head)*NCHUNKS, 2); 470 for_each_possible_cpu(cpu) { 471 struct list_head *unbuddied = 472 per_cpu_ptr(pool->unbuddied, cpu); 473 for_each_unbuddied_list(i, 0) 474 INIT_LIST_HEAD(&unbuddied[i]); 475 } 476 INIT_LIST_HEAD(&pool->lru); 477 INIT_LIST_HEAD(&pool->stale); 478 atomic64_set(&pool->pages_nr, 0); 479 pool->name = name; 480 pool->compact_wq = create_singlethread_workqueue(pool->name); 481 if (!pool->compact_wq) 482 goto out; 483 pool->release_wq = create_singlethread_workqueue(pool->name); 484 if (!pool->release_wq) 485 goto out_wq; 486 INIT_WORK(&pool->work, free_pages_work); 487 pool->ops = ops; 488 return pool; 489 490 out_wq: 491 destroy_workqueue(pool->compact_wq); 492 out: > 493 free_percpu(pool->unbuddied); 494 kfree(pool); 495 return NULL; 496 } 497 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation