Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4586541imm; Wed, 30 May 2018 08:15:48 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIcffX0aZDHjYJzVRm3yWoX90Blv4/gfITnLqxjhNCC/LMB3fZ3ubgo0As0meI5a1jkhLdW X-Received: by 2002:a17:902:1703:: with SMTP id i3-v6mr3252931pli.263.1527693348360; Wed, 30 May 2018 08:15:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527693348; cv=none; d=google.com; s=arc-20160816; b=MVglEU++jdL2XRYil0zcw8IWUZ5fetfVLAVKSxs6RD3GXU/2212oqto7VEgKFlGrIc QFAJtOOeGiVB9jYmyaoYWV/sGll2DvwbJ0NlWQ/9DttJUrsFMq44Upc3/IuhjRxBAbhR FFrn0bWS4SEENAMmM6okilTH0f5bFB4tSh6PY5a2Ng3N+4t/fZwRG8ZbM/uBTd+TTmjz wBv4IrTUxdggG1tk3WghSoNXEo0itMjHJsb0zFNQMHFdE/+ccV+1ghMpCIagefCiKZyY NZu95XcF+7CeD4yPO8UoKFvQLzmsRboiwhUlHfc621tZsHPwncOL98c8Pa9c3IcUYf09 ACEQ== 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:dkim-signature:arc-authentication-results; bh=sb4Lc01GGZayz1hJdSJDMR41ApibWK7ikquKYhouc3Y=; b=wS+BuQ/6feQdkVqzsnz4/nHch2ckqFUg0/mL2fKsPAWZg5I76fMvgOFLOzv6eEr61Y 2YHVlm9gt7dWcCRcYLnhnyrtmGwwaTJogpsr1ULdOC+DlfLWqDRBZDQFUBPSPVBafgt8 PpLOkcx5WrD4syyOOYbBNnMZMfMDhy77uxsLbyUtE0Qes7aWa/iuHFs4/1xJxS6Mrvnn V+vpzocvRBGF57XJ9KtOyrUYfmyMKUa+vDkBGuWom1QjIGE8rKM5Ff4uO2uoEJIBBkuz GZ/cDnZRkjEFwDaB4i8wRxVRoJAaDY2+AXm9pImFhECIyCDAr4k87vNqqWf5/rpF8LfD XGKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=RYe8dG1q; 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 5-v6si35602833plx.517.2018.05.30.08.15.33; Wed, 30 May 2018 08:15:48 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=RYe8dG1q; 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 S1753850AbeE3PNa (ORCPT + 99 others); Wed, 30 May 2018 11:13:30 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:39326 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753248AbeE3PN3 (ORCPT ); Wed, 30 May 2018 11:13:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=sb4Lc01GGZayz1hJdSJDMR41ApibWK7ikquKYhouc3Y=; b=RYe8dG1qBv+mO+Jv1n/hmvWD7 FG6Y/mLu+IJEUExVJLoNoJCKquKXv6x8av+8etSJUUKqKJt1DZIHfE2vA9A3KEhXH8W5UwCKBfmRk RuKOBvIXHQKxsUYoV9iIFEEHf/1lVn1HMlQLr+rt2ryIOK3Brl9lmjI6ehjOMuB9DHsUScRRcPj5/ WiY6Y0prKjA11HGEMv5j5YgKztphf0fFtQvjBrmr2pl0M2h1GXCM2c/V8uaFAmvsI6n3oK2Ak9EDr oHRkkOZnuWuzXoSH7VGIUPMkd6BFE3EPGsFAR2Sfi4MFaCu5YzK4EfEYTcGMFYFwDzCxlxnunRjJY WJOuhj5AA==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fO2n1-00071C-HP; Wed, 30 May 2018 15:13:27 +0000 Date: Wed, 30 May 2018 08:13:27 -0700 From: Matthew Wilcox To: Baolin Wang Cc: linux-mm@kvack.org, LKML , Arnd Bergmann , Mark Brown Subject: Re: [PATCH] mm: dmapool: Check the dma pool name Message-ID: <20180530151327.GA13951@bombadil.infradead.org> References: <59623b15001e5a20ac32b1a393db88722be2e718.1527679621.git.baolin.wang@linaro.org> <20180530120133.GC17450@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 30, 2018 at 08:14:09PM +0800, Baolin Wang wrote: > On 30 May 2018 at 20:01, Matthew Wilcox wrote: > > On Wed, May 30, 2018 at 07:28:43PM +0800, Baolin Wang wrote: > >> It will be crash if we pass one NULL name when creating one dma pool, > >> so we should check the passing name when copy it to dma pool. > > > > NAK. Crashing is the appropriate thing to do. Fix the caller to not > > pass NULL. > > > > If you permit NULL to be passed then you're inviting crashes or just > > bad reporting later when pool->name is printed. > > I think it just prints one NULL pool name. Sometimes the device > doesn't care the dma pool names, so I think we can make code more > solid to valid the passing parameters like other code does. > Or can we add check to return NULL when the passing name is NULL > instead of crashing the kernel? Thanks. No. Fix your driver.