SCSI: qla2xxx: fix error handling of qla2x00_mem_alloc()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 21 Jan 2014 07:00:10 +0000 (10:00 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 May 2014 14:55:30 +0000 (07:55 -0700)
commitdaa12c3ab58832e7a0b402f775078bfc71572ede
treea81de7319c17ad0d6804ab3f60ebf1ff452ecea9
parent4d1e731a8a5f3b5c437dedc8f397d1caf8521a60
SCSI: qla2xxx: fix error handling of qla2x00_mem_alloc()

commit b2a72ec32d0f499aaadf41264232517a12326df0 upstream.

qla2x00_mem_alloc() returns 1 on success and -ENOMEM on failure.  On the
one hand the caller assumes non-zero is success but on the other hand
the caller also assumes that it returns an error code.

I've fixed it to return zero on success and a negative error code on
failure.  This matches the documentation as well.

[jejb: checkpatch fix]
Fixes: e315cd28b9ef ('[SCSI] qla2xxx: Code changes for qla data structure refactoring')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/qla2xxx/qla_os.c