Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2e49cb2 authored by Brian King's avatar Brian King Committed by James Bottomley
Browse files

[SCSI] ipr: Handler ID memory allocation failure at module load time

parent b8d5d568
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -8516,6 +8516,10 @@ static int ipr_alloc_mem(struct ipr_ioa_cfg *ioa_cfg)
					     BITS_TO_LONGS(ioa_cfg->max_devs_supported), GFP_KERNEL);
					     BITS_TO_LONGS(ioa_cfg->max_devs_supported), GFP_KERNEL);
		ioa_cfg->vset_ids = kzalloc(sizeof(unsigned long) *
		ioa_cfg->vset_ids = kzalloc(sizeof(unsigned long) *
					    BITS_TO_LONGS(ioa_cfg->max_devs_supported), GFP_KERNEL);
					    BITS_TO_LONGS(ioa_cfg->max_devs_supported), GFP_KERNEL);

		if (!ioa_cfg->target_ids || !ioa_cfg->array_ids
			|| !ioa_cfg->vset_ids)
			goto out_free_res_entries;
	}
	}


	for (i = 0; i < ioa_cfg->max_devs_supported; i++) {
	for (i = 0; i < ioa_cfg->max_devs_supported; i++) {
@@ -8591,6 +8595,9 @@ static int ipr_alloc_mem(struct ipr_ioa_cfg *ioa_cfg)
			    ioa_cfg->vpd_cbs, ioa_cfg->vpd_cbs_dma);
			    ioa_cfg->vpd_cbs, ioa_cfg->vpd_cbs_dma);
out_free_res_entries:
out_free_res_entries:
	kfree(ioa_cfg->res_entries);
	kfree(ioa_cfg->res_entries);
	kfree(ioa_cfg->target_ids);
	kfree(ioa_cfg->array_ids);
	kfree(ioa_cfg->vset_ids);
	goto out;
	goto out;
}
}