[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250611181710.GB190743@fedora>
Date: Wed, 11 Jun 2025 14:17:10 -0400
From: Stefan Hajnoczi <stefanha@...hat.com>
To: Alok Tiwari <alok.a.tiwari@...cle.com>
Cc: mst@...hat.com, jasowang@...hat.com, michael.christie@...cle.com,
pbonzini@...hat.com, eperezma@...hat.com,
virtualization@...ts.linux.dev, kvm@...r.kernel.org,
darren.kenny@...cle.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] vhost-scsi: Improve error handling in
vhost_scsi_make_nexus and tpg
On Wed, Jun 11, 2025 at 07:39:22AM -0700, Alok Tiwari wrote:
> Use PTR_ERR to return the actual error code when vhost_scsi_make_nexus
> fails to create a session, instead of returning -ENOMEM.
> This ensures more accurate error propagation.
>
> Replace NULL with ERR_PTR(ret) in vhost_scsi_make_tpg to follow kernel
> conventions for pointer-returning functions, allowing callers to use
> IS_ERR and PTR_ERR for proper error handling.
>
> Signed-off-by: Alok Tiwari <alok.a.tiwari@...cle.com>
> ---
> drivers/vhost/scsi.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@...hat.com>
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists