* Re: [PATCH] scsi: virtio_scsi: Remove a useless function call
[not found] <08740635cdb0f8293e57c557b22e048daae50961.1685345683.git.christophe.jaillet@wanadoo.fr>
@ 2023-05-29 14:02 ` Paolo Bonzini
2023-05-29 15:25 ` Stefan Hajnoczi
` (3 subsequent siblings)
4 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2023-05-29 14:02 UTC (permalink / raw)
To: Christophe JAILLET, Michael S. Tsirkin, Jason Wang,
Stefan Hajnoczi, James E.J. Bottomley, Martin K. Petersen
Cc: kernel-janitors, linux-kernel, linux-scsi, virtualization
On 5/29/23 09:35, Christophe JAILLET wrote:
> 'inq_result' is known to be NULL. There is no point calling kfree().
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/scsi/virtio_scsi.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
> index 58498da9869a..bd5633667d01 100644
> --- a/drivers/scsi/virtio_scsi.c
> +++ b/drivers/scsi/virtio_scsi.c
> @@ -338,10 +338,8 @@ static int virtscsi_rescan_hotunplug(struct virtio_scsi *vscsi)
> int result, inquiry_len, inq_result_len = 256;
> char *inq_result = kmalloc(inq_result_len, GFP_KERNEL);
>
> - if (!inq_result) {
> - kfree(inq_result);
> + if (!inq_result)
> return -ENOMEM;
> - }
>
> shost_for_each_device(sdev, shost) {
> inquiry_len = sdev->inquiry_len ? sdev->inquiry_len : 36;
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi: virtio_scsi: Remove a useless function call
[not found] <08740635cdb0f8293e57c557b22e048daae50961.1685345683.git.christophe.jaillet@wanadoo.fr>
2023-05-29 14:02 ` [PATCH] scsi: virtio_scsi: Remove a useless function call Paolo Bonzini
@ 2023-05-29 15:25 ` Stefan Hajnoczi
2023-05-31 15:37 ` Martin K. Petersen
` (2 subsequent siblings)
4 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2023-05-29 15:25 UTC (permalink / raw)
To: Christophe JAILLET
Cc: linux-scsi, Martin K. Petersen, Michael S. Tsirkin,
kernel-janitors, linux-kernel, virtualization, Paolo Bonzini,
James E.J. Bottomley
[-- Attachment #1.1: Type: text/plain, Size: 366 bytes --]
On Mon, May 29, 2023 at 09:35:08AM +0200, Christophe JAILLET wrote:
> 'inq_result' is known to be NULL. There is no point calling kfree().
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/scsi/virtio_scsi.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi: virtio_scsi: Remove a useless function call
[not found] <08740635cdb0f8293e57c557b22e048daae50961.1685345683.git.christophe.jaillet@wanadoo.fr>
2023-05-29 14:02 ` [PATCH] scsi: virtio_scsi: Remove a useless function call Paolo Bonzini
2023-05-29 15:25 ` Stefan Hajnoczi
@ 2023-05-31 15:37 ` Martin K. Petersen
2023-06-02 12:06 ` Michael S. Tsirkin
2023-06-08 1:42 ` Martin K. Petersen
4 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2023-05-31 15:37 UTC (permalink / raw)
To: Christophe JAILLET
Cc: linux-scsi, Martin K. Petersen, Michael S. Tsirkin,
kernel-janitors, linux-kernel, virtualization, Stefan Hajnoczi,
Paolo Bonzini, James E.J. Bottomley
Christophe,
> 'inq_result' is known to be NULL. There is no point calling kfree().
Applied to 6.5/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi: virtio_scsi: Remove a useless function call
[not found] <08740635cdb0f8293e57c557b22e048daae50961.1685345683.git.christophe.jaillet@wanadoo.fr>
` (2 preceding siblings ...)
2023-05-31 15:37 ` Martin K. Petersen
@ 2023-06-02 12:06 ` Michael S. Tsirkin
2023-06-08 1:42 ` Martin K. Petersen
4 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2023-06-02 12:06 UTC (permalink / raw)
To: Christophe JAILLET
Cc: linux-scsi, Martin K. Petersen, kernel-janitors, linux-kernel,
virtualization, Stefan Hajnoczi, Paolo Bonzini,
James E.J. Bottomley
On Mon, May 29, 2023 at 09:35:08AM +0200, Christophe JAILLET wrote:
> 'inq_result' is known to be NULL. There is no point calling kfree().
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> drivers/scsi/virtio_scsi.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
> index 58498da9869a..bd5633667d01 100644
> --- a/drivers/scsi/virtio_scsi.c
> +++ b/drivers/scsi/virtio_scsi.c
> @@ -338,10 +338,8 @@ static int virtscsi_rescan_hotunplug(struct virtio_scsi *vscsi)
> int result, inquiry_len, inq_result_len = 256;
> char *inq_result = kmalloc(inq_result_len, GFP_KERNEL);
>
> - if (!inq_result) {
> - kfree(inq_result);
> + if (!inq_result)
> return -ENOMEM;
> - }
>
> shost_for_each_device(sdev, shost) {
> inquiry_len = sdev->inquiry_len ? sdev->inquiry_len : 36;
> --
> 2.34.1
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi: virtio_scsi: Remove a useless function call
[not found] <08740635cdb0f8293e57c557b22e048daae50961.1685345683.git.christophe.jaillet@wanadoo.fr>
` (3 preceding siblings ...)
2023-06-02 12:06 ` Michael S. Tsirkin
@ 2023-06-08 1:42 ` Martin K. Petersen
4 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2023-06-08 1:42 UTC (permalink / raw)
To: Michael S. Tsirkin, Jason Wang, Paolo Bonzini, Stefan Hajnoczi,
James E.J. Bottomley, Christophe JAILLET
Cc: linux-scsi, kernel-janitors, linux-kernel, Martin K . Petersen,
virtualization
On Mon, 29 May 2023 09:35:08 +0200, Christophe JAILLET wrote:
> 'inq_result' is known to be NULL. There is no point calling kfree().
>
>
Applied to 6.5/scsi-queue, thanks!
[1/1] scsi: virtio_scsi: Remove a useless function call
https://git.kernel.org/mkp/scsi/c/0e5e41ee3d73
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-06-08 1:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <08740635cdb0f8293e57c557b22e048daae50961.1685345683.git.christophe.jaillet@wanadoo.fr>
2023-05-29 14:02 ` [PATCH] scsi: virtio_scsi: Remove a useless function call Paolo Bonzini
2023-05-29 15:25 ` Stefan Hajnoczi
2023-05-31 15:37 ` Martin K. Petersen
2023-06-02 12:06 ` Michael S. Tsirkin
2023-06-08 1:42 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).