[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC v3 16/25] intel_iommu: add PASID cache management infrastructur
From: |
Peter Xu |
Subject: |
Re: [RFC v3 16/25] intel_iommu: add PASID cache management infrastructure |
Date: |
Thu, 13 Feb 2020 10:14:15 -0500 |
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.
--
Peter Xu