[Bug 208275] Kernel panic when reading from /dev/cd0 with a damaged dvd

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 29 Mar 2016 15:58:34 +0000
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208275

--- Comment #9 from Fabian Keil <fk_at_fabiankeil.de> ---
I agree that moving the n calculation behind the error block
is technically sufficient to prevent the panic.

I added the NULL check in front of the brelse() because the function
contains a comment that indicates that passing NULL to it is considered
incorrect.

My assumption was that the brelse() was there for a reason and that bp
would sometimes not be NULL or at least could be in the future.

cluster_read() and bread*() indeed seem to reliably reset bp to NULL
on error, but unlike breadn_flags(), cluster_read() has no comment that
explicitly mentions this, so I wasn't sure that one can depend on this
behaviour.

If the behaviour is unlikely to change in the future, I agree that the
brelse() should be removed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Received on Tue Mar 29 2016 - 13:58:34 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:03 UTC