Ver Fonte

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>
Alan Cox há 16 anos atrás
pai
commit
ec5f5bf805
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      drivers/media/radio/radio-si470x.c

+ 1 - 1
drivers/media/radio/radio-si470x.c

@@ -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 */