All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] scsi: sg: return -ENOMEM on out of memory error
@ 2021-03-11 23:33 Colin King
  2021-03-12  2:32 ` Douglas Gilbert
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-03-11 23:33 UTC (permalink / raw)
  To: Doug Gilbert, James E . J . Bottomley, Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The sg_proc_seq_show_debug should return -ENOMEM on an
out of memory error rather than -1. Fix this.

Fixes: 94cda6cf2e44 ("scsi: sg: Rework debug info")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/sg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 79f05afa4407..85e86cbc6891 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -4353,7 +4353,7 @@ sg_proc_seq_show_debug(struct seq_file *s, void *v)
 	if (!bp) {
 		seq_printf(s, "%s: Unable to allocate %d on heap, finish\n",
 			   __func__, bp_len);
-		return -1;
+		return -ENOMEM;
 	}
 	read_lock_irqsave(&sg_index_lock, iflags);
 	sdp = it ? sg_lookup_dev(it->index) : NULL;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][next] scsi: sg: return -ENOMEM on out of memory error
  2021-03-11 23:33 [PATCH][next] scsi: sg: return -ENOMEM on out of memory error Colin King
@ 2021-03-12  2:32 ` Douglas Gilbert
  0 siblings, 0 replies; 2+ messages in thread
From: Douglas Gilbert @ 2021-03-12  2:32 UTC (permalink / raw)
  To: Colin King, James E . J . Bottomley, Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel

On 2021-03-11 6:33 p.m., Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The sg_proc_seq_show_debug should return -ENOMEM on an
> out of memory error rather than -1. Fix this.
> 
> Fixes: 94cda6cf2e44 ("scsi: sg: Rework debug info")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Douglas Gilbert <dgilbert@interlog.com>

Thanks.

> ---
>   drivers/scsi/sg.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
> index 79f05afa4407..85e86cbc6891 100644
> --- a/drivers/scsi/sg.c
> +++ b/drivers/scsi/sg.c
> @@ -4353,7 +4353,7 @@ sg_proc_seq_show_debug(struct seq_file *s, void *v)
>   	if (!bp) {
>   		seq_printf(s, "%s: Unable to allocate %d on heap, finish\n",
>   			   __func__, bp_len);
> -		return -1;
> +		return -ENOMEM;
>   	}
>   	read_lock_irqsave(&sg_index_lock, iflags);
>   	sdp = it ? sg_lookup_dev(it->index) : NULL;
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-12  2:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11 23:33 [PATCH][next] scsi: sg: return -ENOMEM on out of memory error Colin King
2021-03-12  2:32 ` Douglas Gilbert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.