struct rd_host *rd_host;
rd_host = kzalloc(sizeof(struct rd_host), GFP_KERNEL);
- if (!rd_host) {
- pr_err("Unable to allocate memory for struct rd_host\n");
+ if (!rd_host)
return -ENOMEM;
- }
rd_host->rd_host_id = host_id;
sg = kcalloc(sg_per_table + chain_entry, sizeof(*sg),
GFP_KERNEL);
- if (!sg) {
- pr_err("Unable to allocate scatterlist array"
- " for struct rd_dev\n");
+ if (!sg)
return -ENOMEM;
- }
sg_init_table(sg, sg_per_table + chain_entry);
sg_tables = (total_sg_needed / max_sg_per_table) + 1;
sg_table = kcalloc(sg_tables, sizeof(*sg_table), GFP_KERNEL);
- if (!sg_table) {
- pr_err("Unable to allocate memory for Ramdisk"
- " scatterlist tables\n");
+ if (!sg_table)
return -ENOMEM;
- }
rd_dev->sg_table_array = sg_table;
rd_dev->sg_table_count = sg_tables;
sg_tables = (total_sg_needed / max_sg_per_table) + 1;
sg_table = kcalloc(sg_tables, sizeof(*sg_table), GFP_KERNEL);
- if (!sg_table) {
- pr_err("Unable to allocate memory for Ramdisk protection"
- " scatterlist tables\n");
+ if (!sg_table)
return -ENOMEM;
- }
rd_dev->sg_prot_array = sg_table;
rd_dev->sg_prot_count = sg_tables;
struct rd_host *rd_host = hba->hba_ptr;
rd_dev = kzalloc(sizeof(struct rd_dev), GFP_KERNEL);
- if (!rd_dev) {
- pr_err("Unable to allocate memory for struct rd_dev\n");
+ if (!rd_dev)
return NULL;
- }
rd_dev->rd_host = rd_host;