summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorJan Beulich <JBeulich@suse.com>2016-07-07 01:38:13 -0600
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2016-07-22 08:24:43 -0400
commitaea305e11f7a7af12aa2beb7c7e053a338659c49 (patch)
tree5a12abe60faba674f3f4dd15c19e59efd259da4e /drivers/block
parent530439484d2d9f2a7f1038b1afd3d3543ecc63f6 (diff)
xen-blkback: really don't leak mode property
Commit 9d092603cc ("xen-blkback: do not leak mode property") left one path unfixed; correct this. Acked-by: Jens Axboe <axboe@kernel.dk> Acked-by: Roger Pau Monné <roger.pau@citrix.com> Signed-off-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/xen-blkback/xenbus.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index b44eaf40bb29..4a2412127d8f 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -715,8 +715,11 @@ static void backend_changed(struct xenbus_watch *watch,
/* Front end dir is a number, which is used as the handle. */
err = kstrtoul(strrchr(dev->otherend, '/') + 1, 0, &handle);
- if (err)
+ if (err) {
+ kfree(be->mode);
+ be->mode = NULL;
return;
+ }
be->major = major;
be->minor = minor;