Fix two memory leaks involving dbgbuf that were introduced in port-probe
error paths when backporting the following port-data fixes from v3.7
(which doesn't have dbgbuf):
0978c94 USB: iuu_phoenix: fix sysfs-attribute creation
5363655 USB: iuu_phoenix: fix port-data memory leak
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
}
priv->dbgbuf = kzalloc(256, GFP_KERNEL);
- if (!priv->writebuf) {
+ if (!priv->dbgbuf) {
kfree(priv->writebuf);
kfree(priv->buf);
kfree(priv);
ret = iuu_create_sysfs_attrs(port);
if (ret) {
+ kfree(priv->dbgbuf);
kfree(priv->writebuf);
kfree(priv->buf);
kfree(priv);