Patch "media: s5p-mfc: Add checking to s5p_mfc_probe()." has been added to the 4.14-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: s5p-mfc: Add checking to s5p_mfc_probe().

to the 4.14-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-s5p-mfc-add-checking-to-s5p_mfc_probe.patch
and it can be found in the queue-4.14 subdirectory.

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



commit aa011eca1757e92c91bb973d073a0a142ee7d65f
Author: Nadezda Lutovinova <lutovinova@xxxxxxxxx>
Date:   Wed Aug 11 15:32:28 2021 +0200

    media: s5p-mfc: Add checking to s5p_mfc_probe().
    
    [ Upstream commit cdfaf4752e6915a4b455ad4400133e540e4dc965 ]
    
    If of_device_get_match_data() return NULL,
    then null pointer dereference occurs in  s5p_mfc_init_pm().
    The patch adds checking if dev->variant is NULL.
    
    Found by Linux Driver Verification project (linuxtesting.org).
    
    Signed-off-by: Nadezda Lutovinova <lutovinova@xxxxxxxxx>
    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/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index 63d46fae9b289..75be40608bae8 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -1285,6 +1285,10 @@ static int s5p_mfc_probe(struct platform_device *pdev)
 	}
 
 	dev->variant = of_device_get_match_data(&pdev->dev);
+	if (!dev->variant) {
+		dev_err(&pdev->dev, "Failed to get device MFC hardware variant information\n");
+		return -ENOENT;
+	}
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	dev->regs_base = devm_ioremap_resource(&pdev->dev, res);



[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