Messages in this thread | | | From | Miles Chen <> | Subject | Re: [PATCH v2] iommu/mediatek: fix NULL pointer dereference when printing dev_name | Date | Wed, 27 Apr 2022 10:13:08 +0800 |
| |
hi Robin,
>> - link = device_link_add(dev, larbdev, >> - DL_FLAG_PM_RUNTIME | DL_FLAG_STATELESS); >> - if (!link) >> - dev_err(dev, "Unable to link %s\n", dev_name(larbdev)); >> + if (larbdev) { > >Until the MT8195 infra MMU support lands, is there ever a case where >it's actually valid for larbdev to be NULL? If not, I think it would be >a lot clearer to explicitly fail the probe here, rather than silently >continue and risk fatal errors, hangs, or other weird behaviour if >there's no guarantee that the correct LARB is powered up (plus then the >release callbacks wouldn't need to worry about it either).
Thanks, I will do probe fail in patch v3 and remove the release modification.
thanks, Miles
> >Robin.
| |