]> git.baikalelectronics.ru Git - kernel.git/commit
Drivers: hv: vmbus: Fix synic per-cpu context initialization
authorMichael Kelley <mikelley@microsoft.com>
Fri, 10 Aug 2018 23:06:11 +0000 (23:06 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Sep 2018 07:46:46 +0000 (09:46 +0200)
commitddb9c1363c28179fa7074054faba0507a64cee08
tree2670ed8bb674f0650247211e1e12cb49298e74d5
parent8a802d02ed47b6603e9d019128c573b36c7f6b4a
Drivers: hv: vmbus: Fix synic per-cpu context initialization

If hv_synic_alloc() errors out, the state of the per-cpu context
for some CPUs is unknown since the zero'ing is done as each
CPU is iterated over.  In such case, hv_synic_cleanup() may try to
free memory based on uninitialized values.  Fix this by zero'ing
the per-cpu context for all CPUs before doing any memory
allocations that might fail.

Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hv/hv.c