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: 8c9108d014
("auxdisplay: add a driver for lcd2s character display")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This commit is contained in:
parent
ffdf726db7
commit
2cfd72f81c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue