[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: |
Liu, Yi L |
Subject: |
RE: [RFC v3 16/25] intel_iommu: add PASID cache management infrastructure |
Date: |
Sat, 15 Feb 2020 08:50:20 +0000 |
> -----Original Message-----
> From: Peter Xu <address@hidden>
> Sent: Thursday, February 13, 2020 11:14 PM
> To: Liu, Yi L <address@hidden>
> 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