[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220310212047.GD3927073@dread.disaster.area>
Date: Fri, 11 Mar 2022 08:20:47 +1100
From: Dave Chinner <david@...morbit.com>
To: Jiasheng Jiang <jiasheng@...as.ac.cn>
Cc: djwong@...nel.org, linux-xfs@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] xfs: xfs_rmap_item: Add ASSERT after calling kmem_zalloc
On Thu, Mar 10, 2022 at 05:43:03PM +0800, Jiasheng Jiang wrote:
> As the potential failure of the kmem_zalloc() without __GFP_NOFAIL,
> it should be better to check it in order to avoid the dereference
> of NULL pointer.
kmem_zalloc() won't ever fail unless it is passed KM_MAYFAIL. i.e.
it has __GFP_NOFAIL behaviour when no flags are passed to it, as the
code in xfs_rui_init() does.
Cheers,
Dave.
--
Dave Chinner
david@...morbit.com
Powered by blists - more mailing lists