Messages in this thread | ![/](/images/icornerl.gif) | | Date | Thu, 11 Apr 2024 14:00:53 +0100 | From | Marc Zyngier <> | Subject | Re: [PATCH v2] irqchip/gic-v3-its: Fix double free on error |
| |
On Thu, 11 Apr 2024 12:58:05 +0100, Guanrui Huang <guanrui.huang@linux.alibaba.com> wrote: > > if (vm != domain->host_data) > > This is just a safety check. It looks unlikely happened.
It's not a safety check. It is just papering over problems. If you don't trust the vm pointer, why do you trust the domain pointer? Why do you trust *anything* at all?
> After all, vm is obtained from the args. If the caller has a bug, > can we check here to avoid possible problems that may arise in later > code?
If the caller has a bug, please fix the caller. Don't paper over it.
And you can remove the BUG_ON(!vm) which is equally useless.
Thanks,
M.
-- Without deviation from the norm, progress is not possible.
| ![\](/images/icornerr.gif) |