Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] be2iscsi: Check ASYNC PDU Handle corresponds to HDR/DATA Handle

For each ASYNC PDU received there is an HDR and DATA handle for it.
There will be only 1 HDR ASYNC Handle, but DATA Handle can be more
than 1 for each ASYNC PDU received. Checking if the ASYNC Handle
correspongs to HDR or DATA while returning the Handle to the free list.
hwi_free_async_msg just return the handles to the free list. No return
values are needed so changing the return type to void.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>

authored by

Jayamohan Kallickal and committed by
James Bottomley
9728d8d0 76d15dbd

+2 -6
+2 -6
drivers/scsi/be2iscsi/be_main.c
··· 1471 1471 return 0; 1472 1472 } 1473 1473 1474 - static unsigned int hwi_free_async_msg(struct beiscsi_hba *phba, 1474 + static void hwi_free_async_msg(struct beiscsi_hba *phba, 1475 1475 unsigned int cri) 1476 1476 { 1477 1477 struct hwi_controller *phwi_ctrlr; 1478 1478 struct hwi_async_pdu_context *pasync_ctx; 1479 1479 struct async_pdu_handle *pasync_handle, *tmp_handle; 1480 1480 struct list_head *plist; 1481 - unsigned int i = 0; 1482 1481 1483 1482 phwi_ctrlr = phba->phwi_ctrlr; 1484 1483 pasync_ctx = HWI_GET_ASYNC_PDU_CTX(phwi_ctrlr); ··· 1487 1488 list_for_each_entry_safe(pasync_handle, tmp_handle, plist, link) { 1488 1489 list_del(&pasync_handle->link); 1489 1490 1490 - if (i == 0) { 1491 + if (pasync_handle->is_header) { 1491 1492 list_add_tail(&pasync_handle->link, 1492 1493 &pasync_ctx->async_header.free_list); 1493 1494 pasync_ctx->async_header.free_entries++; 1494 - i++; 1495 1495 } else { 1496 1496 list_add_tail(&pasync_handle->link, 1497 1497 &pasync_ctx->async_data.free_list); 1498 1498 pasync_ctx->async_data.free_entries++; 1499 - i++; 1500 1499 } 1501 1500 } 1502 1501 1503 1502 INIT_LIST_HEAD(&pasync_ctx->async_entry[cri].wait_queue.list); 1504 1503 pasync_ctx->async_entry[cri].wait_queue.hdr_received = 0; 1505 1504 pasync_ctx->async_entry[cri].wait_queue.bytes_received = 0; 1506 - return 0; 1507 1505 } 1508 1506 1509 1507 static struct phys_addr *