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 <novikov@ispras.ru> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
1 parent 670f7ef commit 602649e

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

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)