Commit 2cfd72f8 authored by Dan Carpenter's avatar Dan Carpenter Committed by Miguel Ojeda

auxdisplay: fix use after free in lcd2s_i2c_remove()

The kfree() needs to be moved down a line to prevent a use after free.

Fixes: 8c9108d0 ("auxdisplay: add a driver for lcd2s character display")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
parent ffdf726d
......@@ -348,8 +348,8 @@ static int lcd2s_i2c_remove(struct i2c_client *i2c)
{
struct lcd2s_data *lcd2s = i2c_get_clientdata(i2c);
kfree(lcd2s->charlcd);
charlcd_unregister(lcd2s->charlcd);
kfree(lcd2s->charlcd);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment