lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150916150003.GA2195@udknight>
Date:	Wed, 16 Sep 2015 23:00:03 +0800
From:	Wang YanQing <udknight@...il.com>
To:	mchehab@....samsung.com
Cc:	g.liakhovetski@....de, linux-media@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] [media] soc_camera: soc_camera_pdrv_probe: fix potential
 NULL pointer dereference

Move dereference of sdesc after NULL pointer checker.

Signed-off-by: Wang YanQing <udknight@...il.com>
---
 drivers/media/platform/soc_camera/soc_camera.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
index 9087fed..53b153d 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -2187,13 +2187,14 @@ static int soc_camera_video_start(struct soc_camera_device *icd)
 static int soc_camera_pdrv_probe(struct platform_device *pdev)
 {
 	struct soc_camera_desc *sdesc = pdev->dev.platform_data;
-	struct soc_camera_subdev_desc *ssdd = &sdesc->subdev_desc;
+	struct soc_camera_subdev_desc *ssdd;
 	struct soc_camera_device *icd;
 	int ret;
 
 	if (!sdesc)
 		return -EINVAL;
 
+	ssdd = &sdesc->subdev_desc;
 	icd = devm_kzalloc(&pdev->dev, sizeof(*icd), GFP_KERNEL);
 	if (!icd)
 		return -ENOMEM;
-- 
1.8.5.6.2.g3d8a54e.dirty
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ