Re: [PATCH 07/12] be2iscsi: Fix for premature buffer free

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/04/2010 03:22 PM, Rolf Eike Beer wrote:
Mike Christie wrote:
On 06/29/2010 07:00 PM, Jayamohan Kallickal wrote:

@@ -160,18 +179,34 @@ static int beiscsi_eh_device_reset(struct scsi_cmnd
*sc)

   	spin_unlock_bh(&session->lock);
   	inv_tbl = phba->inv_tbl;

-	tag = mgmt_invalidate_icds(phba, inv_tbl, num_invalidate, cid);
+	nonemb_cmd.va = pci_alloc_consistent(phba->ctrl.pdev,
+				sizeof(struct invalidate_commands_params_in),
+				&nonemb_cmd.dma);
+	if (nonemb_cmd.va == NULL) {
+		SE_DEBUG(DBG_LVL_1,
+			 "Failed to allocate memory for"
+			 "mgmt_invalidate_icds\n");
+		return -1;

return FAILED.

Why not ENOMEM? That would come into my mind when an allocations fails.


Because that function is called by the scsi layer's error handling code and it uses SUCCESS and FAILED for return values.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux