[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1279836546-26913-2-git-send-email-ppannuto@codeaurora.org>
Date: Thu, 22 Jul 2010 15:09:01 -0700
From: Patrick Pannuto <ppannuto@...eaurora.org>
To: linux-kernel@...r.kernel.org
Cc: ppannuto@...eaurora.org, Greg Kroah-Hartman <gregkh@...e.de>,
Emese Revfy <re.emese@...il.com>,
Stephen Hemminger <shemminger@...tta.com>,
Jens Axboe <jens.axboe@...cle.com>
Subject: [PATCH 1/6] Driver core: Fix potential memory leak
In both of the 'goto out' cases, priv has already
been allocated and assigned to bus->p. We reset
bus->p to NULL, but neglect to free bus->p
Signed-off-by: Patrick Pannuto <ppannuto@...eaurora.org>
---
drivers/base/bus.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 12eec3f..eb1b7fa 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -945,8 +945,8 @@ bus_devices_fail:
bus_remove_file(bus, &bus_attr_uevent);
bus_uevent_fail:
kset_unregister(&bus->p->subsys);
- kfree(bus->p);
out:
+ kfree(bus->p);
bus->p = NULL;
return retval;
}
--
1.7.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists