[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.10?] block: Do not unref bs->file on error
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH for-2.10?] block: Do not unref bs->file on error in BD's open |
Date: |
Thu, 27 Apr 2017 16:13:02 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 13.04.2017 um 17:43 hat Max Reitz geschrieben:
> The block layer takes care of removing the bs->file child if the block
> driver's bdrv_open()/bdrv_file_open() implementation fails. The block
> driver therefore does not need to do so, and indeed should not unless it
> sets bs->file to NULL afterwards -- because if this is not done, the
> bdrv_unref_child() in bdrv_open_inherit() will dereference the freed
> memory block at bs->file afterwards, which is not good.
>
> We can now decide whether to add a "bs->file = NULL;" after each of the
> offending bdrv_unref_child() invocations, or just drop them altogether.
> The latter is simpler, so let's do that.
>
> Cc: qemu-stable <address@hidden>
> Signed-off-by: Max Reitz <address@hidden>
Thanks, applied to block-next.
Kevin