Patch "drm/brige/megachips: Add checking if ge_b850v3_lvds_init() is working correctly" 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

    drm/brige/megachips: Add checking if ge_b850v3_lvds_init() is working correctly

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:
     drm-brige-megachips-add-checking-if-ge_b850v3_lvds_i.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 decc88df84b45d7bf7cfd116d63b92fbac862002
Author: Nadezda Lutovinova <lutovinova@xxxxxxxxx>
Date:   Wed Aug 19 17:37:56 2020 +0300

    drm/brige/megachips: Add checking if ge_b850v3_lvds_init() is working correctly
    
    [ Upstream commit f688a345f0d7a6df4dd2aeca8e4f3c05e123a0ee ]
    
    If ge_b850v3_lvds_init() does not allocate memory for ge_b850v3_lvds_ptr,
    then a null pointer dereference is accessed.
    
    The patch adds checking of the return value of ge_b850v3_lvds_init().
    
    Found by Linux Driver Verification project (linuxtesting.org).
    
    Signed-off-by: Nadezda Lutovinova <lutovinova@xxxxxxxxx>
    Signed-off-by: Sam Ravnborg <sam@xxxxxxxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/20200819143756.30626-1-lutovinova@xxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c b/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c
index 6200f12a37e69..ab8174831cf40 100644
--- a/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c
+++ b/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c
@@ -302,8 +302,12 @@ static int stdp4028_ge_b850v3_fw_probe(struct i2c_client *stdp4028_i2c,
 				       const struct i2c_device_id *id)
 {
 	struct device *dev = &stdp4028_i2c->dev;
+	int ret;
+
+	ret = ge_b850v3_lvds_init(dev);
 
-	ge_b850v3_lvds_init(dev);
+	if (ret)
+		return ret;
 
 	ge_b850v3_lvds_ptr->stdp4028_i2c = stdp4028_i2c;
 	i2c_set_clientdata(stdp4028_i2c, ge_b850v3_lvds_ptr);
@@ -361,8 +365,12 @@ static int stdp2690_ge_b850v3_fw_probe(struct i2c_client *stdp2690_i2c,
 				       const struct i2c_device_id *id)
 {
 	struct device *dev = &stdp2690_i2c->dev;
+	int ret;
+
+	ret = ge_b850v3_lvds_init(dev);
 
-	ge_b850v3_lvds_init(dev);
+	if (ret)
+		return ret;
 
 	ge_b850v3_lvds_ptr->stdp2690_i2c = stdp2690_i2c;
 	i2c_set_clientdata(stdp2690_i2c, ge_b850v3_lvds_ptr);



[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