diff options
| -rw-r--r-- | drivers/edac/edac_mc.c | 57 | ||||
| -rw-r--r-- | drivers/scsi/bnx2i/bnx2i_hwi.c | 3 | ||||
| -rw-r--r-- | drivers/scsi/hpsa.c | 3 | ||||
| -rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_base.c | 7 | ||||
| -rw-r--r-- | drivers/scsi/virtio_scsi.c | 2 |
5 files changed, 52 insertions, 20 deletions
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index 616d90bcb3a4..d5dc9da7f99f 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c | |||
| @@ -199,6 +199,36 @@ void *edac_align_ptr(void **p, unsigned size, int n_elems) | |||
| 199 | return (void *)(((unsigned long)ptr) + align - r); | 199 | return (void *)(((unsigned long)ptr) + align - r); |
| 200 | } | 200 | } |
| 201 | 201 | ||
| 202 | static void _edac_mc_free(struct mem_ctl_info *mci) | ||
| 203 | { | ||
| 204 | int i, chn, row; | ||
| 205 | struct csrow_info *csr; | ||
| 206 | const unsigned int tot_dimms = mci->tot_dimms; | ||
| 207 | const unsigned int tot_channels = mci->num_cschannel; | ||
| 208 | const unsigned int tot_csrows = mci->nr_csrows; | ||
| 209 | |||
| 210 | if (mci->dimms) { | ||
| 211 | for (i = 0; i < tot_dimms; i++) | ||
| 212 | kfree(mci->dimms[i]); | ||
| 213 | kfree(mci->dimms); | ||
| 214 | } | ||
| 215 | if (mci->csrows) { | ||
| 216 | for (row = 0; row < tot_csrows; row++) { | ||
| 217 | csr = mci->csrows[row]; | ||
| 218 | if (csr) { | ||
| 219 | if (csr->channels) { | ||
| 220 | for (chn = 0; chn < tot_channels; chn++) | ||
| 221 | kfree(csr->channels[chn]); | ||
| 222 | kfree(csr->channels); | ||
| 223 | } | ||
| 224 | kfree(csr); | ||
| 225 | } | ||
| 226 | } | ||
| 227 | kfree(mci->csrows); | ||
| 228 | } | ||
| 229 | kfree(mci); | ||
| 230 | } | ||
| 231 | |||
| 202 | /** | 232 | /** |
| 203 | * edac_mc_alloc: Allocate and partially fill a struct mem_ctl_info structure | 233 | * edac_mc_alloc: Allocate and partially fill a struct mem_ctl_info structure |
| 204 | * @mc_num: Memory controller number | 234 | * @mc_num: Memory controller number |
| @@ -413,24 +443,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num, | |||
| 413 | return mci; | 443 | return mci; |
| 414 | 444 | ||
| 415 | error: | 445 | error: |
| 416 | if (mci->dimms) { | 446 | _edac_mc_free(mci); |
| 417 | for (i = 0; i < tot_dimms; i++) | ||
| 418 | kfree(mci->dimms[i]); | ||
| 419 | kfree(mci->dimms); | ||
| 420 | } | ||
| 421 | if (mci->csrows) { | ||
| 422 | for (chn = 0; chn < tot_channels; chn++) { | ||
| 423 | csr = mci->csrows[chn]; | ||
| 424 | if (csr) { | ||
| 425 | for (chn = 0; chn < tot_channels; chn++) | ||
| 426 | kfree(csr->channels[chn]); | ||
| 427 | kfree(csr); | ||
| 428 | } | ||
| 429 | kfree(mci->csrows[i]); | ||
| 430 | } | ||
| 431 | kfree(mci->csrows); | ||
| 432 | } | ||
| 433 | kfree(mci); | ||
| 434 | 447 | ||
| 435 | return NULL; | 448 | return NULL; |
| 436 | } | 449 | } |
| @@ -445,6 +458,14 @@ void edac_mc_free(struct mem_ctl_info *mci) | |||
| 445 | { | 458 | { |
| 446 | edac_dbg(1, "\n"); | 459 | edac_dbg(1, "\n"); |
| 447 | 460 | ||
| 461 | /* If we're not yet registered with sysfs free only what was allocated | ||
| 462 | * in edac_mc_alloc(). | ||
| 463 | */ | ||
| 464 | if (!device_is_registered(&mci->dev)) { | ||
| 465 | _edac_mc_free(mci); | ||
| 466 | return; | ||
| 467 | } | ||
| 468 | |||
| 448 | /* the mci instance is freed here, when the sysfs object is dropped */ | 469 | /* the mci instance is freed here, when the sysfs object is dropped */ |
| 449 | edac_unregister_sysfs(mci); | 470 | edac_unregister_sysfs(mci); |
| 450 | } | 471 | } |
diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c index 33d6630529de..91eec60252ee 100644 --- a/drivers/scsi/bnx2i/bnx2i_hwi.c +++ b/drivers/scsi/bnx2i/bnx2i_hwi.c | |||
| @@ -1264,6 +1264,9 @@ int bnx2i_send_fw_iscsi_init_msg(struct bnx2i_hba *hba) | |||
| 1264 | int rc = 0; | 1264 | int rc = 0; |
| 1265 | u64 mask64; | 1265 | u64 mask64; |
| 1266 | 1266 | ||
| 1267 | memset(&iscsi_init, 0x00, sizeof(struct iscsi_kwqe_init1)); | ||
| 1268 | memset(&iscsi_init2, 0x00, sizeof(struct iscsi_kwqe_init2)); | ||
| 1269 | |||
| 1267 | bnx2i_adjust_qp_size(hba); | 1270 | bnx2i_adjust_qp_size(hba); |
| 1268 | 1271 | ||
| 1269 | iscsi_init.flags = | 1272 | iscsi_init.flags = |
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 796482badf13..2b4261cb7742 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
| @@ -1315,8 +1315,9 @@ static void complete_scsi_command(struct CommandList *cp) | |||
| 1315 | } | 1315 | } |
| 1316 | break; | 1316 | break; |
| 1317 | case CMD_PROTOCOL_ERR: | 1317 | case CMD_PROTOCOL_ERR: |
| 1318 | cmd->result = DID_ERROR << 16; | ||
| 1318 | dev_warn(&h->pdev->dev, "cp %p has " | 1319 | dev_warn(&h->pdev->dev, "cp %p has " |
| 1319 | "protocol error \n", cp); | 1320 | "protocol error\n", cp); |
| 1320 | break; | 1321 | break; |
| 1321 | case CMD_HARDWARE_ERR: | 1322 | case CMD_HARDWARE_ERR: |
| 1322 | cmd->result = DID_ERROR << 16; | 1323 | cmd->result = DID_ERROR << 16; |
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index b25757d1e91b..9d5a56c4b332 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.c +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c | |||
| @@ -1209,6 +1209,13 @@ _base_check_enable_msix(struct MPT2SAS_ADAPTER *ioc) | |||
| 1209 | u16 message_control; | 1209 | u16 message_control; |
| 1210 | 1210 | ||
| 1211 | 1211 | ||
| 1212 | /* Check whether controller SAS2008 B0 controller, | ||
| 1213 | if it is SAS2008 B0 controller use IO-APIC instead of MSIX */ | ||
| 1214 | if (ioc->pdev->device == MPI2_MFGPAGE_DEVID_SAS2008 && | ||
| 1215 | ioc->pdev->revision == 0x01) { | ||
| 1216 | return -EINVAL; | ||
| 1217 | } | ||
| 1218 | |||
| 1212 | base = pci_find_capability(ioc->pdev, PCI_CAP_ID_MSIX); | 1219 | base = pci_find_capability(ioc->pdev, PCI_CAP_ID_MSIX); |
| 1213 | if (!base) { | 1220 | if (!base) { |
| 1214 | dfailprintk(ioc, printk(MPT2SAS_INFO_FMT "msix not " | 1221 | dfailprintk(ioc, printk(MPT2SAS_INFO_FMT "msix not " |
diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index c7030fbee79c..3e79a2f00042 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c | |||
| @@ -331,7 +331,7 @@ static void virtscsi_map_sgl(struct scatterlist *sg, unsigned int *p_idx, | |||
| 331 | int i; | 331 | int i; |
| 332 | 332 | ||
| 333 | for_each_sg(table->sgl, sg_elem, table->nents, i) | 333 | for_each_sg(table->sgl, sg_elem, table->nents, i) |
| 334 | sg_set_buf(&sg[idx++], sg_virt(sg_elem), sg_elem->length); | 334 | sg[idx++] = *sg_elem; |
| 335 | 335 | ||
| 336 | *p_idx = idx; | 336 | *p_idx = idx; |
| 337 | } | 337 | } |
