aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorTomas Henzl <thenzl@redhat.com>2014-11-16 08:35:32 -0500
committerChristoph Hellwig <hch@lst.de>2014-11-25 09:42:51 -0500
commitddcae01746b2eefadc78257ca57e327bc9fba791 (patch)
tree3dceb5a0e3ef14e62ce22a8b1a2b329a90dd4d27 /drivers/scsi
parent71bd849dbac99b587cb8a2d34061ecb6abe77c84 (diff)
esas2r: fir error handling in do_fm_api
This patch fixes an error path and rearranges error handling. Signed-off-by: Tomas Henzl <thenzl@redhat.com> Acked-by: Bradley Grove <bgrove@attotech.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/esas2r/esas2r_ioctl.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/scsi/esas2r/esas2r_ioctl.c b/drivers/scsi/esas2r/esas2r_ioctl.c
index d89a0277a8e1..9ac82075546a 100644
--- a/drivers/scsi/esas2r/esas2r_ioctl.c
+++ b/drivers/scsi/esas2r/esas2r_ioctl.c
@@ -117,9 +117,8 @@ static void do_fm_api(struct esas2r_adapter *a, struct esas2r_flash_img *fi)
117 117
118 rq = esas2r_alloc_request(a); 118 rq = esas2r_alloc_request(a);
119 if (rq == NULL) { 119 if (rq == NULL) {
120 up(&a->fm_api_semaphore);
121 fi->status = FI_STAT_BUSY; 120 fi->status = FI_STAT_BUSY;
122 return; 121 goto free_sem;
123 } 122 }
124 123
125 if (fi == &a->firmware.header) { 124 if (fi == &a->firmware.header) {
@@ -135,7 +134,7 @@ static void do_fm_api(struct esas2r_adapter *a, struct esas2r_flash_img *fi)
135 if (a->firmware.header_buff == NULL) { 134 if (a->firmware.header_buff == NULL) {
136 esas2r_debug("failed to allocate header buffer!"); 135 esas2r_debug("failed to allocate header buffer!");
137 fi->status = FI_STAT_BUSY; 136 fi->status = FI_STAT_BUSY;
138 return; 137 goto free_req;
139 } 138 }
140 139
141 memcpy(a->firmware.header_buff, fi, 140 memcpy(a->firmware.header_buff, fi,
@@ -171,9 +170,10 @@ all_done:
171 a->firmware.header_buff, 170 a->firmware.header_buff,
172 (dma_addr_t)a->firmware.header_buff_phys); 171 (dma_addr_t)a->firmware.header_buff_phys);
173 } 172 }
174 173free_req:
175 up(&a->fm_api_semaphore);
176 esas2r_free_request(a, (struct esas2r_request *)rq); 174 esas2r_free_request(a, (struct esas2r_request *)rq);
175free_sem:
176 up(&a->fm_api_semaphore);
177 return; 177 return;
178 178
179} 179}