Patch "media: m5mols: Check function pointer in m5mols_sensor_power" has been added to the 5.4-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: m5mols: Check function pointer in m5mols_sensor_power

to the 5.4-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-m5mols-check-function-pointer-in-m5mols_sensor.patch
and it can be found in the queue-5.4 subdirectory.

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



commit 3e9752346476389e7f74b5bad7ca792eece25859
Author: Tom Rix <trix@xxxxxxxxxx>
Date:   Sun Jul 19 17:34:47 2020 +0200

    media: m5mols: Check function pointer in m5mols_sensor_power
    
    [ Upstream commit 52438c4463ac904d14bf3496765e67750766f3a6 ]
    
    clang static analysis reports this error
    
    m5mols_core.c:767:4: warning: Called function pointer
      is null (null dereference) [core.CallAndMessage]
        info->set_power(&client->dev, 0);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    In other places, the set_power ptr is checked.
    So add a check.
    
    Fixes: bc125106f8af ("[media] Add support for M-5MOLS 8 Mega Pixel camera ISP")
    Signed-off-by: Tom Rix <trix@xxxxxxxxxx>
    Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/media/i2c/m5mols/m5mols_core.c b/drivers/media/i2c/m5mols/m5mols_core.c
index de295114ca482..21666d705e372 100644
--- a/drivers/media/i2c/m5mols/m5mols_core.c
+++ b/drivers/media/i2c/m5mols/m5mols_core.c
@@ -764,7 +764,8 @@ static int m5mols_sensor_power(struct m5mols_info *info, bool enable)
 
 		ret = regulator_bulk_enable(ARRAY_SIZE(supplies), supplies);
 		if (ret) {
-			info->set_power(&client->dev, 0);
+			if (info->set_power)
+				info->set_power(&client->dev, 0);
 			return ret;
 		}
 



[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