]> git.baikalelectronics.ru Git - kernel.git/commit
xen-blkback: do not leak mode property
authorJan Beulich <JBeulich@suse.com>
Thu, 20 Dec 2012 10:31:11 +0000 (10:31 +0000)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tue, 19 Feb 2013 20:16:52 +0000 (15:16 -0500)
commit21f8f2f73fdaaab0b1008d8813f66c41d20f7a76
treeb3a2c673762e0c5c9cff298cf34376f887641f66
parent899fa92bc00fa8bbbf20cfdefa9cd0f8d57e66fa
xen-blkback: do not leak mode property

"be->mode" is obtained from xenbus_read(), which does a kmalloc() for
the message body. The short string is never released, so do it along
with freeing "be" itself, and make sure the string isn't kept when
backend_changed() doesn't complete successfully (which made it
desirable to slightly re-structure that function, so that the error
cleanup can be done in one place).

Reported-by: Olaf Hering <olaf@aepfle.de>
CC: stable@vger.kernel.org
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/block/xen-blkback/xenbus.c