From patchwork Tue Aug 18 03:15:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhen Lei X-Patchwork-Id: 11719707 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5DDB1109B for ; Tue, 18 Aug 2020 03:16:53 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 46DA1207BB for ; Tue, 18 Aug 2020 03:16:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 46DA1207BB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 440021346F6C1; Mon, 17 Aug 2020 20:16:52 -0700 (PDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=45.249.212.191; helo=huawei.com; envelope-from=thunder.leizhen@huawei.com; receiver= Received: from huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1FE6A1346F6B8 for ; Mon, 17 Aug 2020 20:16:47 -0700 (PDT) Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id A88DE6C9636C738149B0; Tue, 18 Aug 2020 11:16:45 +0800 (CST) Received: from DESKTOP-C3MD9UG.china.huawei.com (10.174.177.253) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.487.0; Tue, 18 Aug 2020 11:16:35 +0800 From: Zhen Lei To: Oliver O'Halloran , Dan Williams , Vishal Verma , "Dave Jiang" , Ira Weiny , linux-nvdimm , linux-kernel Subject: [PATCH 0/3] bugfix and optimize for drivers/nvdimm Date: Tue, 18 Aug 2020 11:15:53 +0800 Message-ID: <20200818031556.2921-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.177.253] X-CFilter-Loop: Reflected Message-ID-Hash: AF73BOGHIZXJGE43CJV4MS2X3FFKGXUO X-Message-ID-Hash: AF73BOGHIZXJGE43CJV4MS2X3FFKGXUO X-MailFrom: thunder.leizhen@huawei.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation CC: Zhen Lei X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: I found a memleak when I learned the drivers/nvdimm code today. And I also added a sanity check for priv->bus_desc.provider_name, because strdup() maybe failed. Patch 3 is a trivial source code optimization. Zhen Lei (3): libnvdimm: fix memleak in of_pmem.c libnvdimm: add sanity check for provider_name in of_pmem_region_probe() libnvdimm/bus: simplify walk_to_nvdimm_bus() drivers/nvdimm/bus.c | 7 +++---- drivers/nvdimm/of_pmem.c | 7 +++++++ 2 files changed, 10 insertions(+), 4 deletions(-)