mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 07:00:48 +00:00
[S390] drivers/s390/block/dasd_eckd.c: add missing dasd_sfree_request
Extend some error paths to call dasd_sfree_request as done earlier in the function. The error-handling code is also moved to the end of the function. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
923e9a1399
commit
cd10502b82
@ -2844,6 +2844,7 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_tpm_track(
|
|||||||
sector_t recid, trkid;
|
sector_t recid, trkid;
|
||||||
unsigned int offs;
|
unsigned int offs;
|
||||||
unsigned int count, count_to_trk_end;
|
unsigned int count, count_to_trk_end;
|
||||||
|
int ret;
|
||||||
|
|
||||||
basedev = block->base;
|
basedev = block->base;
|
||||||
if (rq_data_dir(req) == READ) {
|
if (rq_data_dir(req) == READ) {
|
||||||
@ -2884,8 +2885,8 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_tpm_track(
|
|||||||
|
|
||||||
itcw = itcw_init(cqr->data, itcw_size, itcw_op, 0, ctidaw, 0);
|
itcw = itcw_init(cqr->data, itcw_size, itcw_op, 0, ctidaw, 0);
|
||||||
if (IS_ERR(itcw)) {
|
if (IS_ERR(itcw)) {
|
||||||
dasd_sfree_request(cqr, startdev);
|
ret = -EINVAL;
|
||||||
return ERR_PTR(-EINVAL);
|
goto out_error;
|
||||||
}
|
}
|
||||||
cqr->cpaddr = itcw_get_tcw(itcw);
|
cqr->cpaddr = itcw_get_tcw(itcw);
|
||||||
if (prepare_itcw(itcw, first_trk, last_trk,
|
if (prepare_itcw(itcw, first_trk, last_trk,
|
||||||
@ -2897,8 +2898,8 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_tpm_track(
|
|||||||
/* Clock not in sync and XRC is enabled.
|
/* Clock not in sync and XRC is enabled.
|
||||||
* Try again later.
|
* Try again later.
|
||||||
*/
|
*/
|
||||||
dasd_sfree_request(cqr, startdev);
|
ret = -EAGAIN;
|
||||||
return ERR_PTR(-EAGAIN);
|
goto out_error;
|
||||||
}
|
}
|
||||||
len_to_track_end = 0;
|
len_to_track_end = 0;
|
||||||
/*
|
/*
|
||||||
@ -2937,8 +2938,10 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_tpm_track(
|
|||||||
tidaw_flags = 0;
|
tidaw_flags = 0;
|
||||||
last_tidaw = itcw_add_tidaw(itcw, tidaw_flags,
|
last_tidaw = itcw_add_tidaw(itcw, tidaw_flags,
|
||||||
dst, part_len);
|
dst, part_len);
|
||||||
if (IS_ERR(last_tidaw))
|
if (IS_ERR(last_tidaw)) {
|
||||||
return ERR_PTR(-EINVAL);
|
ret = -EINVAL;
|
||||||
|
goto out_error;
|
||||||
|
}
|
||||||
dst += part_len;
|
dst += part_len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2947,8 +2950,10 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_tpm_track(
|
|||||||
dst = page_address(bv->bv_page) + bv->bv_offset;
|
dst = page_address(bv->bv_page) + bv->bv_offset;
|
||||||
last_tidaw = itcw_add_tidaw(itcw, 0x00,
|
last_tidaw = itcw_add_tidaw(itcw, 0x00,
|
||||||
dst, bv->bv_len);
|
dst, bv->bv_len);
|
||||||
if (IS_ERR(last_tidaw))
|
if (IS_ERR(last_tidaw)) {
|
||||||
return ERR_PTR(-EINVAL);
|
ret = -EINVAL;
|
||||||
|
goto out_error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
last_tidaw->flags |= TIDAW_FLAGS_LAST;
|
last_tidaw->flags |= TIDAW_FLAGS_LAST;
|
||||||
@ -2968,6 +2973,9 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_tpm_track(
|
|||||||
cqr->buildclk = get_clock();
|
cqr->buildclk = get_clock();
|
||||||
cqr->status = DASD_CQR_FILLED;
|
cqr->status = DASD_CQR_FILLED;
|
||||||
return cqr;
|
return cqr;
|
||||||
|
out_error:
|
||||||
|
dasd_sfree_request(cqr, startdev);
|
||||||
|
return ERR_PTR(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct dasd_ccw_req *dasd_eckd_build_cp(struct dasd_device *startdev,
|
static struct dasd_ccw_req *dasd_eckd_build_cp(struct dasd_device *startdev,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user