On Mon, Jan 26, 2026 at 11:42:10PM +0530, Kanchan Joshi wrote:
> On 1/21/2026 12:13 PM, Christoph Hellwig wrote:
> > +void fs_bio_integrity_alloc(struct bio *bio)
> > +{
> > + struct fs_bio_integrity_buf *iib;
> > + unsigned int action;
> > +
> > + action = bio_integrity_action(bio);
> > + if (!action)
> > + return;
>
> So this may return from here, but <below>
> > +void fs_bio_integrity_generate(struct bio *bio)
> > +{
> > + fs_bio_integrity_alloc(bio);
>
> no check here. A potential null pointer deference in the next line as
> bio has no bip?
> > + bio_integrity_generate(bio);
> > +}
fs_bio_integrity_alloc is only called when the device has PI metadata
with checksums. So this case can't really happen. That being said,
handling it in one case and not the other seems suboptimal and confusing.