On Fri, May 12, 2023 at 11:16:03AM -0500, Eric Blake wrote: > > > On Wed, May 10, 2023 at 10:35:55PM +0200, Kevin Wolf wrote: > > > > There are some error paths in blk_exp_add() that jump to 'fail:' before > > 'exp' is even created. So we can't just unconditionally access exp->blk. > > > > Add a NULL check, and switch from exp->blk to blk, which is available > > earlier, just to be extra sure that we really cover all cases where > > BlockDevOps could have been set for it (in practice, this only happens > > in drv->create() today, so this part of the change isn't strictly > > necessary). > > > > Fixes: de79b52604e43fdeba6cee4f5af600b62169f2d2 > > Sorry for missing that on my first review, and this does look better. > > I'm assuming you plan to take this in with the rest of the series > through your tree, but let me know if I should push it faster through > the NBD tree.
Because iotest: ./check 307 -nbd fails without this patch but passes with it, Tested-by: Eric Blake <ebl...@redhat.com> [and I should really remember to run more iotests than just the subset run by 'make check' when preparing a pull request...] -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org