radio_si470x: Fix free memory corruption
authorAlan Cox <[email protected]>
Wed, 22 Apr 2009 14:03:15 +0000 (15:03 +0100)
committerLinus Torvalds <[email protected]>
Fri, 24 Apr 2009 14:52:08 +0000 (07:52 -0700)
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 <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/media/radio/radio-si470x.c

index 92c297796a9fd25eb00355072409f45a6a778600..bd945d04dc90cb095e9550c6572aeb32502c2792 100644 (file)
@@ -1200,7 +1200,7 @@ static int si470x_fops_release(struct file *file)
                        video_unregister_device(radio->videodev);
                        kfree(radio->buffer);
                        kfree(radio);
-                       goto unlock;
+                       goto done;
                }
 
                /* stop rds reception */