]> git.baikalelectronics.ru Git - kernel.git/commit
uio_hv_generic: Fix a memory leak in error handling paths
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 9 May 2021 07:13:03 +0000 (09:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 11:26:01 +0000 (13:26 +0200)
commitb459561bc217abe97a42fe87ed6b32315f55aa0d
tree9dbfb32422b80d23500c7c17601ddef0629ced26
parent62f354a258b6b61e14deff78a47d573c3ff8c755
uio_hv_generic: Fix a memory leak in error handling paths

If 'vmbus_establish_gpadl()' fails, the (recv|send)_gpadl will not be
updated and 'hv_uio_cleanup()' in the error handling path will not be
able to free the corresponding buffer.

In such a case, we need to free the buffer explicitly.

Fixes: 2fed193bdf51 ("uio_hv_generic: defer opening vmbus until first use")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/4fdaff557deef6f0475d02ba7922ddbaa1ab08a6.1620544055.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/uio/uio_hv_generic.c