Hi Herbert,

On Fri, Nov 06, 2026 at 07:11:50PM +0800, Herbert Xu wrote:
> On Fri, Oct 16, 2026 at 12:36:40PM +0200, Thorsten Blum wrote:
> > remove_common() frees the driver data during freeze, but does not clear
> > vdev->priv, which points to freed memory. If probe_common() then fails
> > during restore, a later remove or freeze can dereference the dangling
> > pointer.
> > 
> > Clear vdev->priv on the probe_common() error cleanup path and before
> > freeing the driver data in remove_common(). Also reset the device and
> > return early from remove_common() if vdev->priv is already NULL for a
> > safe teardown after a failed restore.
> > 
> > Fixes: 08e53fbdb85c ("virtio-rng: support multiple virtio-rng devices")
> > Cc: [email protected]
> > Signed-off-by: Thorsten Blum <[email protected]>
> > ---
> >  drivers/char/hw_random/virtio-rng.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> 
> Please respond to this comment:
> 
> https://sashiko.dev/#/patchset/20261016103640.4989-2-blum%40kernel.org

I think the issue raised by Sashiko is valid, but also pre-existing and
could therefore be fixed in a separate follow-up patch.

Thanks,
Thorsten

Reply via email to