Re: [PATCH v4 2/4] scsi: core: release legacy ioctl request before user copyback
From: Bart Van Assche
Date: Thu Nov 19 2026 - 16:37:36 EST
On 11/18/26 12:33 AM, Yingjie Wang wrote:
> } else {
> if (copy_to_user(sic->data, buffer, out_len))
> err = -EFAULT;
> }
> + goto error_free_buffer;
>
> error:
> blk_mq_free_request(rq);
A goto statement that only skips the label and the statement that
follows it makes this function harder to read. Has it been considered to
restructure this code such that this goto statement is not necessary,
e.g. by setting 'rq' to NULL after it has been freed and by changing
the code below the 'error' label into the following?
if (rq)
blk_mq_free_request(rq);
Thanks,
Bart.