[Bug 217785] sys/dev/mpr/mpr.c: PVS-Studio: Dead Code (CWE-561)
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 02 Feb 2025 16:26:29 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217785 Warner Losh <imp@FreeBSD.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |Not A Bug CC| |imp@FreeBSD.org Status|New |Closed --- Comment #1 from Warner Losh <imp@FreeBSD.org> --- So this bug doesn't matter. sc->num_reqs is used only to allocate commands and free them on detach. On a panic, neither of these paths is used. So it doesn't matter if this happens before or after the panic. It won't affect the panic. Sometime people make panics advisory (not something in the base). In these cases it's not dead code. And honestly it doesn't matter where it's set. Also, there was a though, ages ago, that this shouldn't be a panic. First, it's a relatively rate situation. Allocating the DMAMAP at this point in the code should always be possible, except if you load the mps driver during a severe memory shortage / fragmentation condition. Second, the driver should be able to cope with the fewer commands, though not as efficiently. It's a no win situation, and as the comments state, it's not at all clear this is a fatal condition. Some users have run with this line commented out. So while there's nothing wrong with this patch, I'm going to reject it and the sister report for mps. It's one more change to the driver I have to test, compile and spend time on that gives no benefit. -- You are receiving this mail because: You are the assignee for the bug.