Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1226177 > unrolled thread
| Started by | Guennadi Liakhovetski <g.liakhovetski@gmx.de> |
|---|---|
| First post | 2015-09-16 17:10 +0200 |
| Last post | 2015-09-16 17:10 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] [media] soc_camera: soc_camera_pdrv_probe: fix potential NULL pointer dereference Guennadi Liakhovetski <g.liakhovetski@gmx.de> - 2015-09-16 17:10 +0200
| From | Guennadi Liakhovetski <g.liakhovetski@gmx.de> |
|---|---|
| Date | 2015-09-16 17:10 +0200 |
| Subject | Re: [PATCH] [media] soc_camera: soc_camera_pdrv_probe: fix potential NULL pointer dereference |
| Message-ID | <q9mvn-821-3@gated-at.bofh.it> |
On Wed, 16 Sep 2015, Wang YanQing wrote:
> Move dereference of sdesc after NULL pointer checker.
>
> Signed-off-by: Wang YanQing <udknight@gmail.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;
NAK. This isn't a dereference. This is just an address calculation.
Thanks
Guennadi
> 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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top | Article view | linux.kernel
csiph-web