Patch "media: tw5864: check status of tw5864_frameinterval_get" has been added to the 5.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    media: tw5864: check status of tw5864_frameinterval_get

to the 5.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     media-tw5864-check-status-of-tw5864_frameinterval_ge.patch
and it can be found in the queue-5.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit bd9eebea1a261a3d1952030c1c1e470f68ff1020
Author: Tom Rix <trix@xxxxxxxxxx>
Date:   Mon Aug 10 21:25:18 2020 +0200

    media: tw5864: check status of tw5864_frameinterval_get
    
    [ Upstream commit 780d815dcc9b34d93ae69385a8465c38d423ff0f ]
    
    clang static analysis reports this problem
    
    tw5864-video.c:773:32: warning: The left expression of the compound
      assignment is an uninitialized value.
      The computed value will also be garbage
            fintv->stepwise.max.numerator *= std_max_fps;
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
    
    stepwise.max is set with frameinterval, which comes from
    
            ret = tw5864_frameinterval_get(input, &frameinterval);
            fintv->stepwise.step = frameinterval;
            fintv->stepwise.min = frameinterval;
            fintv->stepwise.max = frameinterval;
            fintv->stepwise.max.numerator *= std_max_fps;
    
    When tw5864_frameinterval_get() fails, frameinterval is not
    set. So check the status and fix another similar problem.
    
    Signed-off-by: Tom Rix <trix@xxxxxxxxxx>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xxxxxxxxx>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/media/pci/tw5864/tw5864-video.c b/drivers/media/pci/tw5864/tw5864-video.c
index ec1e06da7e4fb..a65114e7ca346 100644
--- a/drivers/media/pci/tw5864/tw5864-video.c
+++ b/drivers/media/pci/tw5864/tw5864-video.c
@@ -767,6 +767,9 @@ static int tw5864_enum_frameintervals(struct file *file, void *priv,
 	fintv->type = V4L2_FRMIVAL_TYPE_STEPWISE;
 
 	ret = tw5864_frameinterval_get(input, &frameinterval);
+	if (ret)
+		return ret;
+
 	fintv->stepwise.step = frameinterval;
 	fintv->stepwise.min = frameinterval;
 	fintv->stepwise.max = frameinterval;
@@ -785,6 +788,9 @@ static int tw5864_g_parm(struct file *file, void *priv,
 	cp->capability = V4L2_CAP_TIMEPERFRAME;
 
 	ret = tw5864_frameinterval_get(input, &cp->timeperframe);
+	if (ret)
+		return ret;
+
 	cp->timeperframe.numerator *= input->frame_interval;
 	cp->capturemode = 0;
 	cp->readbuffers = 2;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux