> -----Original Message----- > From: Peter Xu <peterx@xxxxxxxxxx> > Sent: Thursday, February 13, 2020 11:14 PM > To: Liu, Yi L <yi.l.liu@xxxxxxxxx> > Subject: Re: [RFC v3 16/25] intel_iommu: add PASID cache management > infrastructure > > On Thu, Feb 13, 2020 at 02:59:37AM +0000, Liu, Yi L wrote: > > > - Remove the vtd_pasid_as check right below because it's not needed. > > > > > > > > > > > > > > > > > + if (vtd_pasid_as && > > > ^^^^^^^^^^^^ > > > > yes, it is. In current series vtd_add_find_pasid_as() doesn’t check the > > result of vtd_pasid_as mem allocation, so no need to check vtd_pasid_as > > here either. However, it might be better to check the allocation result > > or it will result in issue if allocation failed. What's your preference > > here? > > That should not be needed, because IIRC g_malloc0() will directly > coredump if allocation fails. Even if not, it'll coredump in > vtd_add_find_pasid_as() soon when accessing the NULL pointer. Cool, thanks for this message. Then I'll follow your suggestion to remove the vtd_pasid_as check. Regards, Yi Liu