Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 34cf1df3 authored by Dan Carpenter's avatar Dan Carpenter Committed by Matthew Garrett
Browse files

sony-laptop: leak in error handling sony_nc_lid_resume_setup()



We need to decrement "i" first because the current "i" was not allocated
succesfully.  Also we should go free the way down to zero to avoid a
leak.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMatthew Garrett <matthew.garrett@nebula.com>
parent fabf85e3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2351,7 +2351,7 @@ static int sony_nc_lid_resume_setup(struct platform_device *pd)
	return 0;

liderror:
	for (; i > 0; i--)
	for (i--; i >= 0; i--)
		device_remove_file(&pd->dev, &lid_ctl->attrs[i]);

	kfree(lid_ctl);