qla2xxx: Indicate out-of-memory with -ENOMEM
authorBart Van Assche <bart.vanassche@sandisk.com>
Wed, 30 Mar 2016 23:25:21 +0000 (16:25 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 11 Apr 2016 20:57:09 +0000 (16:57 -0400)
In the Linux kernel it is preferred to return a meaningful error code
instead of -1. This patch does not change the behavior of the caller of
qla82xx_pinit_from_rom().

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Quinn Tran <quinn.tran@qlogic.com>
Cc: Himanshu Madhani <himanshu.madhani@qlogic.com>
Cc: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Acked-by: Quinn Tran <quinn.tran@qlogic.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_nx.c

index b6b4cfdd76201d76f26ca4a99c60aa49ec6b4c69..54380b434b304eddde918a94ee833e18be6a35f6 100644 (file)
@@ -1229,7 +1229,7 @@ qla82xx_pinit_from_rom(scsi_qla_host_t *vha)
        if (buf == NULL) {
                ql_log(ql_log_fatal, vha, 0x010c,
                    "Unable to allocate memory.\n");
-               return -1;
+               return -ENOMEM;
        }
 
        for (i = 0; i < n; i++) {