]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
scsi/lpfc: Add missing jumps to mempool_free to fix potential memory leak
authorVaios Papadimitriou <vaios.papadimitriou@emulex.com>
Tue, 28 Aug 2012 23:03:13 +0000 (16:03 -0700)
committerJerry Snitselaar <jerry.snitselaar@oracle.com>
Wed, 5 Sep 2012 19:25:50 +0000 (12:25 -0700)
commit id: 4f4c18634d2a05079194ba333c7882349f25d6f7

Signed-off-by: Jerry Snitselaar <jerry.snitselaar@oracle.com>
drivers/scsi/lpfc/lpfc_sli.c

index 8a24aadfb82566907a4e78fe46428b2b530ecdda..b63e19822c60bd01a94c4418d44e2be71e07932d 100644 (file)
@@ -12315,8 +12315,10 @@ lpfc_cq_create(struct lpfc_hba *phba, struct lpfc_queue *cq,
                lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
                                "0361 Unsupported CQ count. (%d)\n",
                                cq->entry_count);
-               if (cq->entry_count < 256)
-                       return -EINVAL;
+               if (cq->entry_count < 256) {
+                       status = -EINVAL;
+                       goto out;
+               }
                /* otherwise default to smallest count (drop through) */
        case 256:
                bf_set(lpfc_cq_context_count, &cq_create->u.request.context,
@@ -12507,8 +12509,10 @@ lpfc_mq_create(struct lpfc_hba *phba, struct lpfc_queue *mq,
                lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
                                "0362 Unsupported MQ count. (%d)\n",
                                mq->entry_count);
-               if (mq->entry_count < 16)
-                       return -EINVAL;
+               if (mq->entry_count < 16) {
+                       status = -EINVAL;
+                       goto out;
+               }
                /* otherwise default to smallest count (drop through) */
        case 16:
                bf_set(lpfc_mq_context_ring_size,
@@ -12797,8 +12801,10 @@ lpfc_rq_create(struct lpfc_hba *phba, struct lpfc_queue *hrq,
                        lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
                                        "2535 Unsupported RQ count. (%d)\n",
                                        hrq->entry_count);
-                       if (hrq->entry_count < 512)
-                               return -EINVAL;
+                       if (hrq->entry_count < 512) {
+                               status = -EINVAL;
+                               goto out;
+                       }
                        /* otherwise default to smallest count (drop through) */
                case 512:
                        bf_set(lpfc_rq_context_rqe_count,
@@ -12878,8 +12884,10 @@ lpfc_rq_create(struct lpfc_hba *phba, struct lpfc_queue *hrq,
                        lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
                                        "2536 Unsupported RQ count. (%d)\n",
                                        drq->entry_count);
-                       if (drq->entry_count < 512)
-                               return -EINVAL;
+                       if (drq->entry_count < 512) {
+                               status = -EINVAL;
+                               goto out;
+                       }
                        /* otherwise default to smallest count (drop through) */
                case 512:
                        bf_set(lpfc_rq_context_rqe_count,