radio_si470x: Fix free memory corruption
The release path for a disconnected device frees the object then unlocks the mutex in the freed object... Found by Dan Carpenter using Smatch Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
@@ -1200,7 +1200,7 @@ static int si470x_fops_release(struct file *file)
|
|||||||
video_unregister_device(radio->videodev);
|
video_unregister_device(radio->videodev);
|
||||||
kfree(radio->buffer);
|
kfree(radio->buffer);
|
||||||
kfree(radio);
|
kfree(radio);
|
||||||
goto unlock;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* stop rds reception */
|
/* stop rds reception */
|
||||||
|
Reference in New Issue
Block a user