Skip to content

Commit

Permalink
esas2r: fir error handling in do_fm_api
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tomas Henzl authored and Christoph Hellwig committed Nov 25, 2014
1 parent 71bd849 commit ddcae01
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/scsi/esas2r/esas2r_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,8 @@ static void do_fm_api(struct esas2r_adapter *a, struct esas2r_flash_img *fi)

rq = esas2r_alloc_request(a);
if (rq == NULL) {
up(&a->fm_api_semaphore);
fi->status = FI_STAT_BUSY;
return;
goto free_sem;
}

if (fi == &a->firmware.header) {
Expand All @@ -135,7 +134,7 @@ static void do_fm_api(struct esas2r_adapter *a, struct esas2r_flash_img *fi)
if (a->firmware.header_buff == NULL) {
esas2r_debug("failed to allocate header buffer!");
fi->status = FI_STAT_BUSY;
return;
goto free_req;
}

memcpy(a->firmware.header_buff, fi,
Expand Down Expand Up @@ -171,9 +170,10 @@ static void do_fm_api(struct esas2r_adapter *a, struct esas2r_flash_img *fi)
a->firmware.header_buff,
(dma_addr_t)a->firmware.header_buff_phys);
}

up(&a->fm_api_semaphore);
free_req:
esas2r_free_request(a, (struct esas2r_request *)rq);
free_sem:
up(&a->fm_api_semaphore);
return;

}
Expand Down

0 comments on commit ddcae01

Please sign in to comment.