* [patch 2/2] [media] av7110: potential divide by zero
@ 2015-11-10 22:23 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2015-11-10 22:23 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: linux-media, kernel-janitors
"len" comes from dvb_video_ioctl() and there is a possibility that it is
zero. We do a divide by len later in the function so that's not ok.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/media/pci/ttpci/av7110_av.c b/drivers/media/pci/ttpci/av7110_av.c
index ccb3b2c..1cf9060 100644
--- a/drivers/media/pci/ttpci/av7110_av.c
+++ b/drivers/media/pci/ttpci/av7110_av.c
@@ -1045,6 +1045,9 @@ static int play_iframe(struct av7110 *av7110, char __user *buf, unsigned int len
dprintk(2, "av7110:%p, \n", av7110);
+ if (len == 0)
+ return 0;
+
if (!(av7110->playing & RP_VIDEO)) {
if (av7110_av_start_play(av7110, RP_VIDEO) < 0)
return -EBUSY;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-11-10 22:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-10 22:23 [patch 2/2] [media] av7110: potential divide by zero Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox