Page MenuHomeFreeBSD

CID 1332000: Logically dead code in sys/dev/pms/RefTisa/tisa/sassata/sas/ini/itdio.c
ClosedPublic

Authored by dab on Feb 12 2019, 6:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 9 2025, 10:16 AM
Unknown Object (File)
Dec 14 2024, 8:09 AM
Unknown Object (File)
Nov 30 2024, 6:47 PM
Unknown Object (File)
Nov 15 2024, 1:50 AM
Unknown Object (File)
Oct 2 2024, 5:36 PM
Unknown Object (File)
Oct 1 2024, 1:24 AM
Unknown Object (File)
Sep 30 2024, 7:41 PM
Unknown Object (File)
Sep 27 2024, 12:24 PM
Subscribers

Details

Summary

A pointer is first tested for NULL. If non-NULL, another pointer is set equal to the first. The second pointer is then checked for NULL and an error path taken if so. This second test and the associated path is dead code as the pointer value, having just been checked for NULL, cannot be NULL at this point. Remove the dead code.

Test Plan

Code inspection

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Looks good to me. I would not be shocked if there are plenty of similar cases elsewhere in the driver.

We should also strongly consider addressing the additional change added at $WORK while we're in this function. I can send you the details, but there was a fairly bad issue in this ioctl path where if ESGL bit in the request isn't initialized the card may end up basically doing a DMA to host memory unexpectedly. Whether we combine that or do a separate review is fine, but that's one of the more... concerning, and discrete fixes (and easily testable by calling the ioctl) that we have that could use upstreaming.

This revision is now accepted and ready to land.Feb 22 2019, 5:01 PM
This revision was automatically updated to reflect the committed changes.