Commit b2141782 authored by Heiko Carstens's avatar Heiko Carstens Committed by James Bottomley

[SCSI] zfcp: Fix fsf_status_read return code handling

If allocation of a status buffer failed the function incorrectly
returned 0 instead of -ENOMEM.
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Peschke <mp3@de.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 9dfe1cc3
...@@ -712,7 +712,7 @@ zfcp_fsf_status_read(struct zfcp_adapter *adapter, int req_flags) ...@@ -712,7 +712,7 @@ zfcp_fsf_status_read(struct zfcp_adapter *adapter, int req_flags)
struct fsf_status_read_buffer *status_buffer; struct fsf_status_read_buffer *status_buffer;
unsigned long lock_flags; unsigned long lock_flags;
volatile struct qdio_buffer_element *sbale; volatile struct qdio_buffer_element *sbale;
int retval = 0; int retval;
/* setup new FSF request */ /* setup new FSF request */
retval = zfcp_fsf_req_create(adapter, FSF_QTCB_UNSOLICITED_STATUS, retval = zfcp_fsf_req_create(adapter, FSF_QTCB_UNSOLICITED_STATUS,
...@@ -731,12 +731,11 @@ zfcp_fsf_status_read(struct zfcp_adapter *adapter, int req_flags) ...@@ -731,12 +731,11 @@ zfcp_fsf_status_read(struct zfcp_adapter *adapter, int req_flags)
sbale[2].flags |= SBAL_FLAGS_LAST_ENTRY; sbale[2].flags |= SBAL_FLAGS_LAST_ENTRY;
fsf_req->sbale_curr = 2; fsf_req->sbale_curr = 2;
retval = -ENOMEM;
status_buffer = status_buffer =
mempool_alloc(adapter->pool.data_status_read, GFP_ATOMIC); mempool_alloc(adapter->pool.data_status_read, GFP_ATOMIC);
if (!status_buffer) { if (!status_buffer)
ZFCP_LOG_NORMAL("bug: could not get some buffer\n");
goto failed_buf; goto failed_buf;
}
memset(status_buffer, 0, sizeof (struct fsf_status_read_buffer)); memset(status_buffer, 0, sizeof (struct fsf_status_read_buffer));
fsf_req->data = (unsigned long) status_buffer; fsf_req->data = (unsigned long) status_buffer;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment