On Fri, Aug 1, 2008 at 2:30 AM, Richard Sharpe
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> I just noticed this ...
>
>        ssc = zalloc(sizeof(struct ssc_info));
>        if (ssc)
>                dtype_priv(lu) = ssc;
>        else
>                return -ENOMEM;
>
>        if (spc_lu_init(lu))
>                return TGTADM_NOMEM;
>
> What should be returned during the creation of an LU?

Good spotting..

Attached is a patch to fix this.
(Sorry for the attachment but I don't have pop/imap access)

It's a one liner..
Included in-line - you never know maybe cut/paste between vim &
firefox 3 on Windows won't destroy the tabs..

>From 105df4ed0ff479e93a15261397d638575b11b840 Mon Sep 17 00:00:00 2001
From: Mark Harvey <[EMAIL PROTECTED]>
Date: Fri, 1 Aug 2008 06:21:39 +1000
Subject: Return correct error code on malloc() failure

Reported-by: Richard Sharpe <[EMAIL PROTECTED]>
Signed-off-by: Mark Harvey <[EMAIL PROTECTED]>
---
 usr/ssc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/usr/ssc.c b/usr/ssc.c
index 848b323..2630a6a 100644
--- a/usr/ssc.c
+++ b/usr/ssc.c
@@ -108,7 +108,7 @@ static int ssc_lu_init(struct scsi_lu *lu)
        if (ssc)
                dtype_priv(lu) = ssc;
        else
-               return -ENOMEM;
+               return TGTADM_NOMEM;

        if (spc_lu_init(lu))
                return TGTADM_NOMEM;
-- 

> _______________________________________________
> Stgt-devel mailing list
> [email protected]
> https://lists.berlios.de/mailman/listinfo/stgt-devel
>

Attachment: 0001-Return-correct-error-code-on-malloc-failure.patch
Description: Binary data

_______________________________________________
Stgt-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/stgt-devel

Reply via email to