[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220427021308.22855-1-miles.chen@mediatek.com>
Date: Wed, 27 Apr 2022 10:13:08 +0800
From: Miles Chen <miles.chen@...iatek.com>
To: <robin.murphy@....com>
CC: <angelogioacchino.delregno@...labora.com>,
<hverkuil-cisco@...all.nl>, <iommu@...ts.linux-foundation.org>,
<joro@...tes.org>, <jroedel@...e.de>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>,
<linux-mediatek@...ts.infradead.org>, <matthias.bgg@...il.com>,
<mchehab@...nel.org>, <miles.chen@...iatek.com>, <will@...nel.org>,
<yong.wu@...iatek.com>
Subject: Re: [PATCH v2] iommu/mediatek: fix NULL pointer dereference when printing dev_name
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.
Powered by blists - more mailing lists