xen/blkback: fix reference counting
authorVegard Nossum <vegard.nossum@oracle.com>
Thu, 5 Sep 2013 11:00:14 +0000 (13:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Dec 2013 18:56:25 +0000 (10:56 -0800)
commitd0ac18ce1a3d607ad650fd4b9d371be75a5c8e3a
tree1e55191247006b44fa06f447a692e83e51722988
parentef0d74867fc7e440b0e945e7fe47a862dbc9c9ef
xen/blkback: fix reference counting

commit ea5ec76d76da9279d12027c1828544c5ccbe7932 upstream.

If the permission check fails, we drop a reference to the blkif without
having taken it in the first place. The bug was introduced in commit
604c499cbbcc3d5fe5fb8d53306aa0fae1990109 (xen/blkback: Check device
permissions before allowing OP_DISCARD).

Cc: Jan Beulich <JBeulich@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/xen-blkback/blkback.c