Skip to content

Commit 602649e

Browse files
eunovmmchehab
authored andcommitted
media: davinci: vpif_capture: fix potential double free
In case of errors vpif_probe_complete() releases memory for vpif_obj.sd and unregisters the V4L2 device. But then this is done again by vpif_probe() itself. The patch removes the cleaning from vpif_probe_complete(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Evgeny Novikov <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 670f7ef commit 602649e

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

drivers/media/platform/davinci/vpif_capture.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,8 +1482,6 @@ static int vpif_probe_complete(void)
14821482
/* Unregister video device */
14831483
video_unregister_device(&ch->video_dev);
14841484
}
1485-
kfree(vpif_obj.sd);
1486-
v4l2_device_unregister(&vpif_obj.v4l2_dev);
14871485

14881486
return err;
14891487
}

0 commit comments

Comments
 (0)