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)
Fri, Apr 5, 10:46 AM
Unknown Object (File)
Jan 28 2024, 10:07 PM
Unknown Object (File)
Jan 10 2024, 10:05 PM
Unknown Object (File)
Dec 21 2023, 6:32 AM
Unknown Object (File)
Dec 20 2023, 1:13 AM
Unknown Object (File)
Dec 11 2023, 2:30 AM
Unknown Object (File)
Nov 25 2023, 9:04 PM
Unknown Object (File)
Nov 23 2023, 12:20 AM
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.