mirror of
https://github.com/qemu/qemu.git
synced 2024-11-29 23:03:41 +08:00
virtio-blk: Remove useless condition around g_free()
Laszlo spotted and studied this wasteful "if". He pointed out: The original virtio_blk_free_request needed an "if" as it accesses one field, since671ec3f056
("virtio-blk: Convert VirtIOBlockReq.elem to pointer", 2014-06-11); later on inf897bf751f
("virtio-blk: embed VirtQueueElement in VirtIOBlockReq", 2014-07-09) the field became embedded, so the "if" became unnecessary (at which point we were using g_slice_free(), but it is the same. Now drop it. Reported-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
3ba34a7022
commit
1d29b5b049
@ -42,9 +42,7 @@ static void virtio_blk_init_request(VirtIOBlock *s, VirtQueue *vq,
|
||||
|
||||
static void virtio_blk_free_request(VirtIOBlockReq *req)
|
||||
{
|
||||
if (req) {
|
||||
g_free(req);
|
||||
}
|
||||
g_free(req);
|
||||
}
|
||||
|
||||
static void virtio_blk_req_complete(VirtIOBlockReq *req, unsigned char status)
|
||||
|
Loading…
Reference in New Issue
Block a user