[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1269094385-16114-4-git-send-email-w.sang@pengutronix.de>
Date: Sat, 20 Mar 2010 15:12:44 +0100
From: Wolfram Sang <w.sang@...gutronix.de>
To: kernel-janitors@...r.kernel.org
Cc: linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org,
Wolfram Sang <w.sang@...gutronix.de>,
David Brownell <dbrownell@...rs.sourceforge.net>,
Greg Kroah-Hartman <gregkh@...e.de>, linux-usb@...r.kernel.org
Subject: [PATCH 03/24] usb/otg/isp1301_omap: Fix dangling pointer
Fix this i2c-driver which missed setting clientdata to NULL before freeing the
structure it points to. Found by a semantic patch, but fixed by hand.
Signed-off-by: Wolfram Sang <w.sang@...gutronix.de>
Cc: David Brownell <dbrownell@...rs.sourceforge.net>
Cc: Greg Kroah-Hartman <gregkh@...e.de>
---
drivers/usb/otg/isp1301_omap.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/otg/isp1301_omap.c b/drivers/usb/otg/isp1301_omap.c
index 78a2097..0ad16e3 100644
--- a/drivers/usb/otg/isp1301_omap.c
+++ b/drivers/usb/otg/isp1301_omap.c
@@ -1224,7 +1224,9 @@ static void isp1301_release(struct device *dev)
/* ugly -- i2c hijacks our memory hook to wait_for_completion() */
if (isp->i2c_release)
isp->i2c_release(dev);
- kfree (isp);
+
+ i2c_set_clientdata(isp->client, NULL);
+ kfree(isp);
}
static struct isp1301 *the_transceiver;
@@ -1629,6 +1631,7 @@ isp1301_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
return 0;
fail:
+ i2c_set_clientdata(i2c, NULL);
kfree(isp);
return -ENODEV;
}
--
1.7.0
--
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