msm: sensor: Fix potential NULL ptr dereference

Fix potential NULL ptr dereference in msm_cci and
msm_csiphy driver.

CRs-Fixed: 981832
Change-Id: I8b7a807c20fd6ff2636943e779597d20459d2d88
Signed-off-by: Xu Han <hanxu@codeaurora.org>
This commit is contained in:
Xu Han 2016-03-04 16:11:48 -08:00 committed by Bryan Huntsman
parent 20804741fe
commit 64d192c0e2
2 changed files with 8 additions and 5 deletions
drivers/media/platform/msm/camera_v2/sensor

View file

@ -2014,15 +2014,15 @@ static int msm_cci_probe(struct platform_device *pdev)
goto cci_no_resource;
}
new_cci_dev->irq = msm_camera_get_irq(pdev, "cci");
CDBG("%s line %d cci irq start %d end %d\n", __func__,
__LINE__,
(int) new_cci_dev->irq->start,
(int) new_cci_dev->irq->end);
if (!new_cci_dev->irq) {
pr_err("%s: no irq resource?\n", __func__);
rc = -ENODEV;
goto cci_no_resource;
}
CDBG("%s line %d cci irq start %d end %d\n", __func__,
__LINE__,
(int) new_cci_dev->irq->start,
(int) new_cci_dev->irq->end);
rc = msm_camera_register_irq(pdev, new_cci_dev->irq,
msm_cci_irq, IRQF_TRIGGER_RISING, "cci", new_cci_dev);
if (rc < 0) {

View file

@ -1360,7 +1360,10 @@ static long msm_csiphy_subdev_ioctl(struct v4l2_subdev *sd,
{
int rc = -ENOIOCTLCMD;
struct csiphy_device *csiphy_dev = v4l2_get_subdevdata(sd);
CDBG("%s:%d id %d\n", __func__, __LINE__, csiphy_dev->pdev->id);
if (!csiphy_dev) {
pr_err("%s:%d failed\n", __func__, __LINE__);
return -EINVAL;
}
mutex_lock(&csiphy_dev->mutex);
switch (cmd) {
case VIDIOC_MSM_SENSOR_GET_SUBDEV_ID: