Index | Thread | Search

From:
Theo Buehler <tb@theobuehler.org>
Subject:
Re: Remove inconsistent NULL check in ffs_realloccg
To:
Rafael Sadowski <rafael@sizeofvoid.org>
Cc:
tech@openbsd.org
Date:
Fri, 19 Sep 2025 23:17:53 +0200

Download raw body.

Thread
On Fri, Sep 19, 2025 at 10:30:35PM +0200, Rafael Sadowski wrote:
> ffs_realloccg()  always sets *bpp to  NULL at the start, so checking bpp
> != NULL later is unnecessary. Remove the useless check.

This doesn't look right. I don't know much about ffs interna but...

Currently a caller can do ffs_realloccg(..., NULL, blknop) if it doesn't
care about the bpp or it can do ffs_realloccg(..., &bp, blocknop) with
an uninitialized struct buf *bp and the function will initialize it
whether it succeeds or not. Your diff breaks callers of the first kind.