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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
}