diff mbox

xen-blkback: really don't leak mode property

Message ID 577E230502000078000FBE0D@prv-mh.provo.novell.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Beulich July 7, 2016, 7:38 a.m. UTC
Commit 9d092603cc ("xen-blkback: do not leak mode property") left one
path unfixed; correct this.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 drivers/block/xen-blkback/xenbus.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Roger Pau Monné July 7, 2016, 9:17 a.m. UTC | #1
On Thu, Jul 07, 2016 at 01:38:13AM -0600, Jan Beulich wrote:
> Commit 9d092603cc ("xen-blkback: do not leak mode property") left one
> path unfixed; correct this.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Konrad Rzeszutek Wilk July 7, 2016, 3:33 p.m. UTC | #2
On Thu, Jul 07, 2016 at 11:17:14AM +0200, Roger Pau Monne wrote:
> On Thu, Jul 07, 2016 at 01:38:13AM -0600, Jan Beulich wrote:
> > Commit 9d092603cc ("xen-blkback: do not leak mode property") left one
> > path unfixed; correct this.
> > 
> > Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Acked-by: Roger Pau Monné <roger.pau@citrix.com>

Queued.
diff mbox

Patch

--- 4.7-rc6-xen.orig/drivers/block/xen-blkback/xenbus.c
+++ 4.7-rc6-xen/drivers/block/xen-blkback/xenbus.c
@@ -715,8 +715,11 @@  static void backend_changed(struct xenbu
 
 	/* 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;