* Coverity: get_md_pagetable(): Control flow issues
@ 2022-11-02 19:57 coverity-bot
2022-11-02 20:14 ` Jason Gunthorpe
0 siblings, 1 reply; 2+ messages in thread
From: coverity-bot @ 2022-11-02 19:57 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: Jason Gunthorpe, Nicolin Chen, Yi Liu, Gustavo A. R. Silva,
linux-next, linux-hardening
Hello!
This is an experimental semi-automated report about issues detected by
Coverity from a scan of next-20221102 as part of the linux-next scan project:
https://scan.coverity.com/projects/linux-next-weekly-scan
You're getting this email because you were associated with the identified
lines of code (noted below) that were touched by commits:
Mon Oct 31 20:18:38 2022 -0300
147393321d65 ("iommufd: Add a selftest")
Coverity reported the following:
*** CID 1527089: Control flow issues (UNREACHABLE)
/drivers/iommu/iommufd/selftest.c: 248 in get_md_pagetable()
242 IOMMUFD_OBJ_HW_PAGETABLE);
243 if (IS_ERR(obj))
244 return ERR_CAST(obj);
245 hwpt = container_of(obj, struct iommufd_hw_pagetable, obj);
246 if (hwpt->domain->ops != mock_ops.default_domain_ops) {
247 return ERR_PTR(-EINVAL);
vvv CID 1527089: Control flow issues (UNREACHABLE)
vvv This code cannot be reached: "iommufd_put_object(&hwpt->o...".
248 iommufd_put_object(&hwpt->obj);
249 }
250 *mock = container_of(hwpt->domain, struct mock_iommu_domain, domain);
251 return hwpt;
252 }
253
If this is a false positive, please let us know so we can mark it as
such, or teach the Coverity rules to be smarter. If not, please make
sure fixes get into linux-next. :) For patches fixing this, please
include these lines (but double-check the "Fixes" first):
Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1527089 ("Control flow issues")
Fixes: 147393321d65 ("iommufd: Add a selftest")
Thanks for your attention!
--
Coverity-bot
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Coverity: get_md_pagetable(): Control flow issues
2022-11-02 19:57 Coverity: get_md_pagetable(): Control flow issues coverity-bot
@ 2022-11-02 20:14 ` Jason Gunthorpe
0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2022-11-02 20:14 UTC (permalink / raw)
To: coverity-bot
Cc: Nicolin Chen, Yi Liu, Gustavo A. R. Silva, linux-next,
linux-hardening
On Wed, Nov 02, 2022 at 12:57:33PM -0700, coverity-bot wrote:
> /drivers/iommu/iommufd/selftest.c: 248 in get_md_pagetable()
> 242 IOMMUFD_OBJ_HW_PAGETABLE);
> 243 if (IS_ERR(obj))
> 244 return ERR_CAST(obj);
> 245 hwpt = container_of(obj, struct iommufd_hw_pagetable, obj);
> 246 if (hwpt->domain->ops != mock_ops.default_domain_ops) {
> 247 return ERR_PTR(-EINVAL);
> vvv CID 1527089: Control flow issues (UNREACHABLE)
> vvv This code cannot be reached: "iommufd_put_object(&hwpt->o...".
> 248 iommufd_put_object(&hwpt->obj);
> 249 }
> 250 *mock = container_of(hwpt->domain, struct mock_iommu_domain, domain);
> 251 return hwpt;
> 252 }
> 253
>
> If this is a false positive, please let us know so we can mark it as
> such, or teach the Coverity rules to be smarter. If not, please make
> sure fixes get into linux-next. :) For patches fixing this, please
> include these lines (but double-check the "Fixes" first):
Yes, we already fixed this, thanks
Jason
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-11-02 20:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-02 19:57 Coverity: get_md_pagetable(): Control flow issues coverity-bot
2022-11-02 20:14 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox