Return correct error code on malloc() failure

Mark Harvey markh794
Thu Jul 31 22:21:39 CEST 2008


Reported-by: Richard Sharpe <realrichardsharpe at gmail.com>
Signed-off-by: Mark Harvey <markh794 at gmail.com>
---
 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
> Stgt-devel at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/stgt-devel
>

------=_Part_975_11561062.1217540557307
Content-Type: application/octet-stream;
 name=0001-Return-correct-error-code-on-malloc-failure.patch
Content-Transfer-Encoding: base64
X-Attachment-Id: f_fjbw2mia0
Content-Disposition: attachment;
 filename=0001-Return-correct-error-code-on-malloc-failure.patch

RnJvbSAxMDVkZjRlZDBmZjQ3OWU5M2ExNTI2MTM5N2Q2Mzg1NzViMTFiODQwIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBNYXJrIEhhcnZleSA8bWFya2g3OTRAZ21haWwuY29tPgpEYXRl
OiBGcmksIDEgQXVnIDIwMDggMDY6MjE6MzkgKzEwMDAKU3ViamVjdDogUmV0dXJuIGNvcnJlY3Qg
ZXJyb3IgY29kZSBvbiBtYWxsb2MoKSBmYWlsdXJlCgpSZXBvcnRlZC1ieTogUmljaGFyZCBTaGFy
cGUgPHJlYWxyaWNoYXJkc2hhcnBlQGdtYWlsLmNvbT4KU2lnbmVkLW9mZi1ieTogTWFyayBIYXJ2
ZXkgPG1hcmtoNzk0QGdtYWlsLmNvbT4KLS0tCiB1c3Ivc3NjLmMgfCAgICAyICstCiAxIGZpbGVz
IGNoYW5nZWQsIDEgaW5zZXJ0aW9ucygrKSwgMSBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS91
c3Ivc3NjLmMgYi91c3Ivc3NjLmMKaW5kZXggODQ4YjMyMy4uMjYzMGE2YSAxMDA2NDQKLS0tIGEv
dXNyL3NzYy5jCisrKyBiL3Vzci9zc2MuYwpAQCAtMTA4LDcgKzEwOCw3IEBAIHN0YXRpYyBpbnQg
c3NjX2x1X2luaXQoc3RydWN0IHNjc2lfbHUgKmx1KQogCWlmIChzc2MpCiAJCWR0eXBlX3ByaXYo
bHUpID0gc3NjOwogCWVsc2UKLQkJcmV0dXJuIC1FTk9NRU07CisJCXJldHVybiBUR1RBRE1fTk9N
RU07CiAKIAlpZiAoc3BjX2x1X2luaXQobHUpKQogCQlyZXR1cm4gVEdUQURNX05PTUVNOwotLSAK
MS41LjQuMwoK
------=_Part_975_11561062.1217540557307--



More information about the stgt mailing list